Forum Moderators: open

Message Too Old, No Replies

Dynamic image popup viewer

Creating an image popup fitted to image size

         

quietus

6:58 pm on Jul 14, 2003 (gmt 0)

10+ Year Member



I've made a script much with the help of WebmasterWorld but am now looking to improve the script slightly. I want the window opened to have the exact width and height of the image loaded, and I guess this isn't impossible?

<SCRIPT>
function show(txt)
{
var filedesc = "images/jpeg/mayfair/mayfair"+txt+"stor.jpg"
window.open ('popup.html?'+filedesc, 'newwindow', config='height=480,width=640, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, directories=no, status=no');
}
</SCRIPT>

The function calling the script, show(txt) where txt is a three digit code matching the number in the filename..

killroy

7:24 pm on Jul 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You have to use JS inside the popup that resized the window on <img onload=> by then you can know hte image sizes

SN