Results 1 to 2 of 2

Thread: Need Coding Expert Help For Minor Pop Under Script Adjustment

  1. #1
    Join Date
    Mar 2020
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Need Coding Expert Help For Minor Pop Under Script Adjustment

    Hi, I was wondering any coding expert is able to help me setup a timer code for the pop under provided by javascriptkit like the code below. It works fine, but I prefer for the pop under to kick in lets say in 2mins time after someone clicked on the link instead of immediately. Much appreciated for those who can help!

    Code:
    <script>
    
    //Pop-under window- By JavaScript Kit
    //Credit notice must stay intact for use
    //Visit http://javascriptkit.com for this script
    
    //specify page to pop-under
    var popunder="http://yahoo.com"
    
    //specify popunder window features
    //set 1 to enable a particular feature, 0 to disable
    var winfeatures="width=800,height=510,scrollbars=1,resizable=1,toolbar=1,location=1,menubar=1,status=1,directories=0"
    
    //Pop-under only once per browser session? (0=no, 1=yes)
    //Specifying 0 will cause popunder to load every time page is loaded
    var once_per_session=0
    
    ///No editing beyond here required/////
    
    function get_cookie(Name) {
      var search = Name + "="
      var returnvalue = "";
      if (document.cookie.length > 0) {
        offset = document.cookie.indexOf(search)
        if (offset != -1) { // if cookie exists
          offset += search.length
          // set index of beginning of value
          end = document.cookie.indexOf(";", offset);
          // set index of end of cookie value
          if (end == -1)
             end = document.cookie.length;
          returnvalue=unescape(document.cookie.substring(offset, end))
          }
       }
      return returnvalue;
    }
    
    function loadornot(){
    if (get_cookie('popunder')==''){
    loadpopunder()
    document.cookie="popunder=yes"
    }
    }
    
    function loadpopunder(){
    win2=window.open(popunder,"",winfeatures)
    win2.blur()
    window.focus()
    }
    
    if (once_per_session==0)
    loadpopunder()
    else
    loadornot()
    
    </script>
    Last edited by james438; 03-14-2020 at 09:13 AM. Reason: format

  2. #2
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,879
    Thanks
    49
    Thanked 265 Times in 257 Posts
    Blog Entries
    56

    Default

    You could try to replace
    Code:
    win2=window.open(popunder,"",winfeatures)
    with something like
    Code:
    win2=setTimeout('window.open(popunder,"",winfeatures)',120000)

Similar Threads

  1. minor Feature Request for a DD-Script
    By kobo1d in forum Dynamic Drive scripts help
    Replies: 15
    Last Post: 05-15-2010, 02:49 PM
  2. Ajax Pagination Script small adjustment issue
    By pink-sheep in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 09-23-2007, 06:40 AM
  3. Ajax Tabs Content script minor problem/question..
    By SolidSnke in forum Dynamic Drive scripts help
    Replies: 5
    Last Post: 09-18-2006, 04:50 AM
  4. Minor Help with AJAX script
    By achtungbaby in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 11-15-2005, 03:56 AM
  5. Minor bug in Smart Folding Menu Tree Script
    By bastide in forum Bug reports
    Replies: 0
    Last Post: 04-28-2005, 12:43 PM

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
  •