How Do I Make An Exit Popup?

Discussion in 'HTML & Website Design' started by amcfad2, Apr 27, 2011.

  1. #1
    I want to make an affiliate url open when people close my site. How do I code that? This is the site: http://howbigarebedbugs.com/. Its a wordpress blog
     
    amcfad2, Apr 27, 2011 IP
  2. RamCity

    RamCity Peon

    Messages:
    732
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #2
    RamCity, Apr 27, 2011 IP
  3. amcfad2

    amcfad2 Greenhorn

    Messages:
    83
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    18
    #3
    amcfad2, Apr 27, 2011 IP
  4. RamCity

    RamCity Peon

    Messages:
    732
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Have a little time on Google with the keyphrase Exit Pop-up in Wordpress.

    Google is free and fast for you. :)
     
    RamCity, Apr 27, 2011 IP
  5. amcfad2

    amcfad2 Greenhorn

    Messages:
    83
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    18
    #5
    I did look. I'm looking for a full page exit pop up not just a box to capture emails.
     
    amcfad2, Apr 27, 2011 IP
  6. RamCity

    RamCity Peon

    Messages:
    732
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Full exit pop-up is nothing the resize of its width and height as per visitor's screen resolution.
     
    RamCity, Apr 27, 2011 IP
  7. amcfad2

    amcfad2 Greenhorn

    Messages:
    83
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    18
    #7
    right so i'm asking what the code to do that is...
     
    amcfad2, Apr 27, 2011 IP
  8. amcfad2

    amcfad2 Greenhorn

    Messages:
    83
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    18
    #8
    I still haven't found anything that works the way I want. Can anyone help?
     
    amcfad2, Apr 27, 2011 IP
  9. stack

    stack Active Member

    Messages:
    134
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    85
    #9
    Seriously, google it. 3 of the top 5 results offer a solution.
     
    stack, Apr 27, 2011 IP
  10. ineedq

    ineedq Greenhorn

    Messages:
    64
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #10
    Place the following script between the <HEAD> and </HEAD> tags:
    
    <script language="javascript">
    <!-- begin
    
    var exit=true;
    function exitwindow()
    {
    var url = 'URL/to/popup.html';
    var win = 'toolbar=0,directories=0,menubar=0,scrollbars=0,
    resizable=0,width=250,height=300';
    if (exit)
    open(url,'WindowName',win); }
    
    // end -->
    </script>
    
    Add the following into your <BODY> tag:
    
    onUnload="exitwindow()"
    
    Your <BODY> tag should then look something like this:
    
    <BODY bgcolor="#ffffff" text="#000000" onUnload="exitwindow()">
    
    And add the following into all internal links where you DO NOT want the new window to open:
    
    onclick="exit=false"
    
    For example:
    
    <A href="http://www.nowsell.com/order.html" onclick="exit=false">Order Now</A>
    
    Although the script above is designed specifically to create an exit pop-up, you can in fact quite easily turn a standard on-entry pop-up into an exit pop-up.
    
    How?
    
    Simply change the onLoad command in the <BODY> tag to onUnload. You will still have to insert the onclick="exit=false" code into the links you don't want to trigger the pop-up.
    
    
    Code (markup):
     
    ineedq, Apr 27, 2011 IP
  11. RamCity

    RamCity Peon

    Messages:
    732
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #11
    In fact it is the best solution. :)
     
    RamCity, Apr 28, 2011 IP