Web Analytics Made Easy -
StatCounter Adding text to popup window - CodingForum

Announcement

Collapse
No announcement yet.

Adding text to popup window

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Adding text to popup window

    Hi

    The code below opens an image into a popup window. The command line <a href="javascripticture('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="javascripticture('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="javascripticture('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

  • #2
    <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>

    Comment

    Working...
    X