yarub Posted June 11, 2006 Share Posted June 11, 2006 Bah... it's still not working.I'm looking for a way to make it so a link to a picture is auto-resized if it's wider than 175 pixels. At the same time, if it's smaller than 175 pixels, it will not resize at all.Can anyone help?[code]<img src='$row[profileimage]' onload='if(largerThan(this.width,175)) {this.width=175;this.alt=Click for a large version.;}' onmouseover='if(this.alt) this.style.cursor='pointer' onclick='if(this.alt) window.open('$row[profileimage]')' border='0' />[/code]Does not work. >_<; Quote Link to comment https://forums.phpfreaks.com/topic/11684-resizing-images-stuff/ Share on other sites More sharing options...
jeremywesselman Posted June 11, 2006 Share Posted June 11, 2006 You have posted this in the wrong section. This has nothing to do with PHP! Mods, please move to the Javascript Forum.[!--coloro:#990000--][span style=\"color:#990000\"][!--/coloro--]Jeremy[!--colorc--][/span][!--/colorc--] Quote Link to comment https://forums.phpfreaks.com/topic/11684-resizing-images-stuff/#findComment-44213 Share on other sites More sharing options...
yarub Posted June 11, 2006 Author Share Posted June 11, 2006 Well, whether or not it involves php or javascript, I still need help. It's got a little bit of both in it so I wasn't sure where to throw it. In any case, how can I fix it? Quote Link to comment https://forums.phpfreaks.com/topic/11684-resizing-images-stuff/#findComment-44385 Share on other sites More sharing options...
nogray Posted June 12, 2006 Share Posted June 12, 2006 You can use PHP to get the image size and print out the correct size.[code]<?phplist($width, $height, $type, $attr) = getimagesize("img/flag.jpg");if ($width > 175) $width=175;echo "<img src=\"img/flag.jpg\" width=\"$width\" />";?> [/code] Quote Link to comment https://forums.phpfreaks.com/topic/11684-resizing-images-stuff/#findComment-44660 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.