SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: Popup windows

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2000
    Posts
    46
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Whats the code to setup pop up windows? I've got a page that I want to say Happy Birthday but I want it to popup different windows with messages; sort of like those popup ads.

  2. #2
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Give this a try (in your head tag...you can change the width and height numbers, etc)P

    Code:
    <script language="JavaScript">
    <!--
    function popupWindow(url) { window.open(url,'popup','width=395,height=330,menubar=no,scrollbars=yes,toolbar=no,location=no,directories=no,resizable=no,top=50,left=50'); }
    //-->
    </script>
    Then, this wherever you would like the link to active the window appear

    Code:
    <a href="" onClick="popupWindow('page.html'); return false;" onMouseOver="window.status='Click to Launch Popup!'; return true;" onMouseOut="window.status='';">
    Click to Launch Popup!</a>
    Hope that helps.


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
  •