Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Oct 2002
    Posts
    144
    Thanks
    12
    Thanked 0 Times in 0 Posts

    A Little Assistance Required Please

    Hi Guys,

    Please see script below.

    <script language="JavaScript"><!--
    function openWin(img) {
    winId = window.open('','newwin','width=400,height=450');
    winId.document.write('<body onLoad="if (window.focus) window.focus()"><center>');
    winId.document.write('<img src="' + img + '">');
    winId.document.write('</center></body>');
    winId.document.close();
    }
    //--></script>

    <a href="javascript:;" onMouseover="openWin('images/headcovers.gif'); return false">image1</a>
    <a href="javascript:;" onMouseover="openWin('images/colour.gif'); return false">image2</a>
    <a href="javascript:;" onClick="openWin('images/WILTS.gif'); return false">image3</a>

    This works great. My need is to include in the script a button to close the popup. :o

  • #2
    New Coder
    Join Date
    Aug 2002
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    winId = window.open('','newwin','width=400,height=450');
    winId.document.write('<body onLoad="if (window.focus) window.focus()"><center>');
    winId.document.write('<img src="' + img + '">');
    winId.document.write('<a href="javascript:(window.close());">close</a>');
    winId.document.write('</center></body>');
    winId.document.close();

  • #3
    Regular Coder
    Join Date
    Oct 2002
    Posts
    144
    Thanks
    12
    Thanked 0 Times in 0 Posts
    Well blow me down. Thanks Dan I should have seen that.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •