PDA

View Full Version : Adding text to popup window


allyson
06-30-2002, 10:58 AM
Hi

The code below opens an image into a popup window. The command line <a href="javascript:picture('blinking_eye.gif')">
<p>Click here</a> </p>
loads blinking_eye.gif into the window. How could
I modify it, so that a description of the image could appear. I'd like it, so that the text could be added at the href point, similar to the following <a href="javascript:picture('blinking_eye.gif', 'This is a picture of an eye)">

I'm just not sure how to modify the function?



<script language="javascript">

function picture(pic){
var no=" addrbar=0,toolbar=0,location=0,directories=0,"
no+="status=1,menubar=0,scrollbars=0,resizeable=0,"
no+="width=720,height=576"


var mywin=window.open("","def",no)

mywin.document.write("<center><img src='"+pic+"'>")
mywin.document.write("<BR><BR><BR>")
mywin.document.write("<input type='button' value=' Close Window ' onclick='java script:window.close()'>")

}
</script>
</head>

<body>
<a href="javascript:picture('blinking_eye.gif')">

<p>Click here</a> </p>

<p>&nbsp;</p>

<p>&nbsp;</p>
</body>
</html>

I got this function from a previous thread on this forum. It's a great site.

Thank-you
bye Allyson

x_goose_x
06-30-2002, 03:35 PM
<html>

<head>

<script language="javascript">

function picture(pic,desc){
var no=" addrbar=0,toolbar=0,location=0,directories=0,"
no+="status=1,menubar=0,scrollbars=0,resizeable=0,"
no+="width=720,height=576"

var mywin=window.open("","def",no)

mywin.document.write("<center><img src='"+pic+"'>")
mywin.document.write("<BR>"+desc+"<BR>")
mywin.document.write("<input type='button' value=' Close Window ' onclick='java script:window.close()'>")

}

</script>

</head>

<body>

<a href="javascripticture('blinking_eye.gif','This picture is a blinking eye.')">
Click here</a>

</body>
</html>