Skip to content
WJunction - Webmaster Forum

Auto Image Resize

Status
Not open for further replies.

5 comments

if above code not work
then try this javascript code
Using javascript to control images


This method is very easy and simple by add the following javascript code in your-theme/main.tpl before </head>
PHP:
<script type="text/javascript"> window.onload= function() {     ims = document.images;     for (var i in ims) {         if (ims[i].width > 500) {             ims[i].width=500;             ims[i].height=Math.round(ims[i].height*500/ims[i].width);         }     } } </script>
 
This is good solution for resizing the image..But it resize all the image in the post.

If I want to resize only my 1st image in the post what's the solution.
Code:
http://www.dlestarter.com/tutorials/223-control-images-size-is-easy.html
 
Status
Not open for further replies.

About the author

S
Banned · Joined
613
Messages
330
Reactions
63
Points
Grow your business

Advertise on WJunction

Connect with an established international community of webmasters, hosting providers, developers and online entrepreneurs.

  • Premium & Premium+ Sticky
  • Dedicated section banners
  • Site-wide banner advertising
Explore advertising options
Back
Top Bottom