runnerjp Posted January 12, 2007 Share Posted January 12, 2007 [code]<script>var images = document.images;foreach(images as image) image.style.width=image.width;</script>[/code] this should stop my images resizing but it doesnt why not :( Quote Link to comment Share on other sites More sharing options...
Psycho Posted January 12, 2007 Share Posted January 12, 2007 That is javascript. But the foreach [b]foreach(images as image)[/b] is PHP, it does not work like that in javascript. Quote Link to comment Share on other sites More sharing options...
runnerjp Posted January 12, 2007 Author Share Posted January 12, 2007 so how can i chnage it to all php?? Quote Link to comment Share on other sites More sharing options...
Psycho Posted January 12, 2007 Share Posted January 12, 2007 [code][code]I think this is what you are looking for.[code]function resize() { var images = document.images; for (i=0; i<images.length; i++) { images[i].style.width=images[i].width; }}[/code]Of course you would need to run in onload of the page. But, what resizing are you trying to prevent? Are you trying to prevent the resizing that IE does on it's own? If so, I don't know that you can do that - just turn off the image resizing option in IE preferences.[/code][/code] Quote Link to comment Share on other sites More sharing options...
runnerjp Posted January 12, 2007 Author Share Posted January 12, 2007 well it keeps resizing all my images on my website and it does not look good...wats wierd about it is that im putitng it as the original size any way :S Quote Link to comment Share on other sites More sharing options...
Psycho Posted January 12, 2007 Share Posted January 12, 2007 "well [b]it[/b] keeps resizing all my images "What keeps resising your images? Is the browser resizing them after the page loads or are they sized incorrectly/ Can you provide a link to your page? Quote Link to comment Share on other sites More sharing options...
runnerjp Posted January 12, 2007 Author Share Posted January 12, 2007 [url=http://www.runnerselite.com]www.runnerselite.com[/url] u can see the running image and the logo gets resized but i dont dunerstand why they get resized as that is the size they arwe if that makes sence Quote Link to comment Share on other sites More sharing options...
Psycho Posted January 12, 2007 Share Posted January 12, 2007 I'm not sure what you mean. In the image you are setting the height and width of the image as follows:<IMG SRC="http://www.runnerselite.com/image/training.jpg" [b]WIDTH=105 HEIGHT=97[/b] ALT="Starflower">The way the image is displayed for me on that page looks right for those dimensions. Quote Link to comment 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.