SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    May 2006
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    click an image to 'close' that window

    Anyone know how to do this?

    I have a little image. When users click on it, it should close that window. what goes in the link box on dreamweaver? thank you much!

  2. #2
    I ♥ PHP
    Join Date
    Jul 2003
    Location
    Melbourne, Australia
    Posts
    579
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This should work IwillOutworkYou:
    HTML Code:
    <script type="text/javascript">
    
      function closeIt()
      {
        window.close();
      }
    
    </script>
    
    <img src="" alt="" onclick="closeIt();" />
    The only thing to keep in mind is that a script can only close a window that was opened by a script.

    Regards,
    Jordan

  3. #3
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,290
    Mentioned
    198 Post(s)
    Tagged
    3 Thread(s)

    window.close

    Quote Originally Posted by J Windebank
    The only thing to keep in mind is that a script can only close a window that was opened by a script.
    .... or you will get a "script is trying to close window. Do you want to allow it?" alert

  4. #4
    I ♥ PHP
    Join Date
    Jul 2003
    Location
    Melbourne, Australia
    Posts
    579
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not in Firefox...


Bookmarks

Posting Permissions

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