1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Make a link to a small pop-up window? (HTML)

Discussion in 'HTML & Website Design' started by dpatel304, Mar 29, 2008.

  1. #1
    I want to create a link that will keep the user on the current page, but open a small pop up window (a window that won't show an adderss bar, favorites, or any sort of toolbars) that is basically just blank and will feature text.
    SEMrush
    Example of this: On most vbulletin forums, when you use the 'go advanced' reply, there will be a box for smileys. If there are too many smileys, you can click 'more' and it will open up a window similar to what I am looking for, with more smileys. I don't think DP has this, but most other forums with a lot of smileys will feature this.

    Anyway, I have a link for a contest, and just want the link to open a small pop-up window with the rules.

    Thanks in advance.
     
    dpatel304, Mar 29, 2008 IP
    SEMrush
  2. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    434
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You're going to have to use JavaScript for this. Unfortunately I'm not home (and have not been for several days), otherwise I'd pull the script out of my code library and give it to you.
     
    Dan Schulz, Mar 29, 2008 IP
  3. owenj

    owenj Guest

    Messages:
    25
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Use this for your link:
    
    <a href='javascript:window.open("http://yoururl","contestrules", "menubar=0,resizable=0,width=350,height=350");'>link text</a>
    
    Code (markup):
    You should change yoururl to the url of the contest rules. contestrules can stay the same this is the window identifier. Link text should be the text you want to display for the link.

    Hope this helps!
     
    owenj, Mar 29, 2008 IP
  4. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    434
    Best Answers:
    0
    Trophy Points:
    0
    #4
    That will fail if the user's browser doesn't support JavaScript or if the script gets forcibly removed by a firewall.
     
    Dan Schulz, Mar 30, 2008 IP
  5. J.T.D.

    J.T.D. Peon

    Messages:
    86
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Wouldn't this be better?

    
    <a href="filename.html" onClick="javascript:window.open('http://yoururl.tld/filename.html','POPUP Window', 'menubar=0,resizable=0,width=350,height=350"); return false;'>link text</a>
    
    Code (markup):
    That way if the user has Javascript disabled, the window still opens.

    - JTD
     
    J.T.D., Mar 31, 2008 IP
    mr_wonderful likes this.
  6. bigdork

    bigdork Peon

    Messages:
    26
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    @ JTD
    
    <a href="filename.html" onClick="javascript:window.open('http://yoururl.tld/filename.html','POPUP Window', 'menubar=0,resizable=0,width=350,height=350"); return false;'>link text</a>
    Code (markup):
    wouldn't that cause the filename.html to be loaded in the main browser window and the popup??
     
    bigdork, Mar 31, 2008 IP
  7. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    434
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Dan Schulz, Mar 31, 2008 IP