Click to See Complete Forum and Search --> : Pop Up Window From Image


bilco105
03-30-2003, 04:19 AM
Hello,

I am not very good at javascript so this script would need to be described in newbie terms :-(

I am looking for a pop up window script. Basically it is a image pop up script.

When the user clicks an image of my choise it pops up a window I can choose the size of, url and so forth

What is the script for this?

Thankyou for your time

Ice3T
03-30-2003, 08:04 AM
Ok so you know how to put an image with html
<img src="somedirectory/picture.gif">
you just add in that tag:
onLoad="window.open()"
it looks like this:
<img src="somedirectory/picture.gif" onLoad="window.open()">

now if you leav it like that it will open a blank window
so to specify the url and size and whatever else

in the "()" of window.open() you add three series of this single quotes seperated by a comma like this:
'1','2','3'
it will then look like this
window.open(' ',' ',' ')

now replace #1 with the url you want
now replace #2 with a name you want to give that page (if you dont want to get fancy, just leave this one empty)
now replace #3 with stuff like this (you can use 1, 2 or how many you want):
width=650,height=768,toolbar=1

and the final result:

<img src"directory/NameOfYourImage.jpg" onClick="onLoad="window.open('http://www.canadapost.ca/tools/pcl/bin/range-e.asp','','width=650,height=768,top=50,left=25,toolbar=1,menubar=1,scrollbars=1,resizable=1,location =1,directories=1,status=1')">