Pop Up Window

S

Sarah UK

Im sorry i bet this is a really stupid question but im thick .....
Can you create a small set sized window that pops up when you click an image
and it displays text ... for example ... a picture of a printer which you
click on and all the information appears in a small box with all the
details???
 
T

Trevor L.

Sarah said:
Im sorry i bet this is a really stupid question but im thick .....
Can you create a small set sized window that pops up when you click
an image and it displays text ... for example ... a picture of a
printer which you click on and all the information appears in a small
box with all the details???

Hey, not stupid.

It is one that many ask as it is a very common want.

Jim Cheshire has solved this. Download spawnJimcoPopup from
http://www.jimcosoftware.com/

You call it from your HTML by
spawnJimcoPopup(url, name, options, h, w, x, y, scaleType)
where
url is the html file to open
name is its name, which can be blank , i.e. ''
options is a list of options for toolbars, etc. - all yes or no
h the height of the window
w the width of the window
x is its position from the left
y is its position from the top
scaleType is percent or pixel for the h and w parameters

x can be set to "center" to center the window

An example
<a href="#" onclick="spawnJimcoPopup
('picture.html','',
'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no',
'180','200', 'center','500','pixel');return false;">
<img src="images/display/question.gif"
alt="" height="24" />Click here for more info</a>

In picture.html you can put anything you want, e.g the text to accompany the
image.
In my case, the image is a question mark, but you can put a nice picture of
a printer into <img src=".............

The download from Jimco gives you a nice interface to FP, but if you don't
want to download it, here is my version of spawnJimco Popup
(I have modified it slightly to allow centring in either x or y direction)

function spawnJimcoPopup(url, name, options, h, w, x, y, scaleType)
{
if (scaleType == 'percent')
{ h = (h * screen.availHeight) / 100
w = (w * screen.availWidth) / 100 }
if (x == 'center')
x = (screen.availWidth - w) / 2
if (y == 'center')
y = (screen.availHeight - h) / 2
options += ',width=' + w + ',height=' + h
+ ',left=' + x + ',top=' + y
var newWindow = window.open(url, name, options)
newWindow.focus()
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top