Forum Moderators: open

Message Too Old, No Replies

Pop up pictures

How do I add a pop window?

         

steelrane

7:44 pm on Jan 26, 2004 (gmt 0)

10+ Year Member



I have a web site that I want to put a link so when someone wants to see the back of one of my products they can just click it and a smaller window pops up with the picture of the back of the product I'm using FP 2002 and XP pro Please help?

katy8439

10:32 am on Feb 9, 2004 (gmt 0)

10+ Year Member



Here's one way of doing it:
<html>
<head>
<title>Test</title>
<script langauage="javascript">
function NewWindow(mypage, myname) {
winprops = 'height=400,width=600,scrollbars=yes,resizable, status=no, address=yes'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
</script>
</head>

<body>

<a href="#" onClick="NewWindow('product.jpg','name');return false;">Click here for Product</a>

</body>
</html>

You can the window size can be changed by altering the height/width properties in the Script section. Change 'product.jpg' to the location of the page or file you want to open

Katy

Blue_Wizard

12:02 am on Feb 14, 2004 (gmt 0)

10+ Year Member



if you need links to multiple pop ups each with their own custom sizes
try this

<a href="http://www.yourdomain.com/exactpath/image.jpg" target="_blank" onclick="PopUp=window.open('http://www.yourdomain.com/exactpath/image.jpg', 'NewWin', 'resizable=yes,width=380,height=380,left=50,top=25,screenX=50,screenY=25'); PopUp.focus(); return false;">name of link </a>

note the absolute url is there twice for it to work
set the width and the height slightly larger than the image if you want the entire image to be visible without scrolling

steelrane

1:25 am on Feb 14, 2004 (gmt 0)

10+ Year Member



wow thanks for all the help i'll try both of these ideas.

thehittmann

2:26 am on Feb 14, 2004 (gmt 0)

10+ Year Member



<a href="javascript:window.open('[YourURL]','[YourWindowName]','[WindowOption1],[WindowOption2],etc...');"

Common window options are:
width=(in pixels, e.g. 350)
height=(in pixels)
toolbar=(yes/no)
directories=(yes/no)
location=(yes/no)
menubar=(yes/no)
resizeable=(yes/no)
scrollbars=(yes/no)
status=(yes/no)

<a href="" OnClick="window.close()">Close Window</a>