I meant, in the script, there is a document.getElementById on the image's id, did you change that to the I'd of your image?
I meant, in the script, there is a document.getElementById on the image's id, did you change that to the I'd of your image?
"Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program." - Linus Torvalds
Anime Views Forums
Bernie
Actually, try:
And then in your body tag, change:Code:var imageWidth = document.getElementById('yourimageid'); var imageHeight = document.getElementById('yourimageid'); function changeSize(){ if(imageWidth.width < 240 && imageHeight.height < 320){ var inside = true; } else{ var inside = false; } if(inside = false){ imageWidth.width = 240 ; imageHeight.heght = 320; } }
To:Code:<body>
And also remember to change the part in red to the actuall id of the outputted image.Code:<body onload="changeSize()">
"Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program." - Linus Torvalds
Anime Views Forums
Bernie
Where do I integrate it?
Code:$ImageDisplay = $ImageDisplay = "<img src='$FileLocation' alt='' style='width:expression( document.body.clientWidth > 239 ? 240px : auto );max-width:240px;height: expression( this.scrollHeight > 319 ? 320px : auto );max-height:320px;' border='0' align='middle'>"; }
The following is the display box in which all images appear. There is no particular ID...
Code:<div style="margin-left:0; height:320px; " ><div style=" padding-top:<?php echo($DownFromTop); ?>px;"><?php echo($ImageDisplay); ?></div></div>
Last edited by KennyP; 08-13-2012 at 08:26 AM.
In the head, you want some script tags, ie:
And you want to put it between them. Remember to change the id in the script, so if the id of your image is "image" change the red parts that I posted to "image". Also remember to modify the body tag.Code:<script type="text/javascript"> </script>
also,
Please use the forum's bbcode tags to make it more readable:
for php code............[php] <?php /* code goes here */ ?> [/php]
for html...............[html] <!-- markup goes here -->.....[/html]
for js/css/other.......[code] code goes here................[/code]
"Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program." - Linus Torvalds
Anime Views Forums
Bernie
I just had a crazy idea (probably won't work).
If you haven't tried this already, try this -
Code:$ImageDisplay = "<img src='$FileLocation' alt='' style='width:inherit;height:inherit;' border='0' align='middle'>";
Last edited by keyboard; 08-13-2012 at 08:56 AM.
That win't work, because of the non-escaped double quote in it,.
"Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program." - Linus Torvalds
Anime Views Forums
Bernie
Nice edit there keyboard, there was a quote in alt, which you then removed.
"Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program." - Linus Torvalds
Anime Views Forums
Bernie
No. That one didn't work in either browser. The previous code which works in FF is now reloaded.
Maybe we could try hypnosis. We'll tell IE that it is really FF and maybe it will behave like it![]()
Bookmarks