Click to See Complete Forum and Search --> : diferent sized popups


lazymusicmann
12-09-2003, 01:53 PM
ok so i have my site. www.anotherrun.tk alright and if you go to the pictures section and click a thumbnail you will notice that there is extra white space. i need to know how to make it change the size of the frame to fit each picture. right now it all opens the same size and i just made it big enough to fit each one in. i would like it to fit perfectly around each picture with no white space. that or = amounts of white space around it. i just used the popup generator and i have some knoledge in javascript but not much so please help me. thanks!

TheBearMay
12-09-2003, 03:07 PM
Looking at your code you have a function that reads:

function popUp(URL) {
...
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,
statusbar=0, menubar=0,resizable=0,width=455,height=450, left = 172.5,top = 75');")

If we change it to:

function popUp(URL, imageWidth, imageHeight) {
...
if(imageWidth < 50) imageWidth=455;
if (imageHeight < 50) imageHeight=450;

eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,
statusbar=0, menubar=0,resizable=0,width='+imageWidth+',
height='+imageHeight+',left = 172.5,top = 75');")



you now have a function that you can control the size of the popup. You can get the true sizes by examining the properties of the images, and manually coding them into the call of the function (don't know of a way to query an image's attributes before it's loaded).

lazymusicmann
12-09-2003, 04:48 PM
ok i copyed and pasted now what will my call look like? lets say the image is 426 wide and 272 height? and do i need ot put that in the top too? thanks

lazymusicmann
12-10-2003, 10:03 PM
what does the call look like???

TheBearMay
12-11-2003, 07:57 AM
Try: popUp("imagePath", 426, 272)

lazymusicmann
12-11-2003, 12:32 PM
ahh i know why i didnt think of that. my xhtml class makes me put " " around every thing. noresize="noresize" and such so i dont need them around numbers kool thanks.

lazymusicmann
12-11-2003, 12:44 PM
damnit! it still aint working!!!!