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 2 of 2

Thread: popup via link

  1. #1
    New Coder
    Join Date
    Jul 2003
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question popup via link

    hey how do i popup a window when a user clicks a link? like how can i make a link open up in a new popup window. kinda like a popup ad where i can set the variables like size and stuff but it opens when they click a link? thanks so much...

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,068
    Thanks
    0
    Thanked 256 Times in 252 Posts
    Code:
    function pop(url, target){
      var w = window.open(url, target, 'width=800,height=400,resizable=1');
      w.focus();
      return false;
    }
    HTML:
    <a href="page.htm" target="popup1" onclick="return pop(this.href, this.target)">Popup 1</a>
    <a href="page2.htm" target="popup2" onclick="return pop(this.href, this.target)">Popup 2</a>

    For more details of the window features, go here.
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________


  •  

    Posting Permissions

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