Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
Old 01-07-2005, 09:39 PM Popups
Harvey's Avatar
Super Spam Talker

Posts: 901
Name: Harvey C
Location: Brighton, UK
Trades: 0
Hi,

Can anybody tell me how to make it so a popup appears after a delay, of 300 seconds for example? I have done this before, but also need to make sure that the popop only appears once per browser session, for example.

Thanks
Harvey is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-08-2005, 06:20 AM
sdcdesign.co.uk's Avatar
Extreme Talker

Posts: 198
Location: High Wycombe, Buckinghamshire, London
Trades: 0
harveycarpenter,

I'm not sure if this will work but it looks ok to me!

Code:
<script type="text/javascript">


function openpopup(){
var winpops=window.open("page.html","","width=,height=,toolbar,location,status,scrollbars,menubar,resizable")
}

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 popIt(){
if (get_cookie('jkpopup')==''){
openpopup(popup[Math.floor(Math.random()*(popup.length))])
document.cookie="jkpopup=yes"
}
}

setTimeout("popIt();",3000);
</script>
It is set to 3 seconds, and you'll have to change 'page.html' to which page you want to open!

Regards,

Sean
__________________
[ Insert witty, yet highly intelligent signature here ]

Last edited by sdcdesign.co.uk; 01-08-2005 at 06:27 AM..
sdcdesign.co.uk is offline
Reply With Quote
View Public Profile Visit sdcdesign.co.uk's homepage!
 
Old 01-08-2005, 06:43 PM Legend
Harvey's Avatar
Super Spam Talker

Posts: 901
Name: Harvey C
Location: Brighton, UK
Trades: 0
Thanks so much for that; it's greatly appreciated
Harvey is offline
Reply With Quote
View Public Profile
 
Old 01-08-2005, 10:13 PM
sdcdesign.co.uk's Avatar
Extreme Talker

Posts: 198
Location: High Wycombe, Buckinghamshire, London
Trades: 0
No worries harveycarpenter! Anytime

Regards,

Sean
__________________
[ Insert witty, yet highly intelligent signature here ]
sdcdesign.co.uk is offline
Reply With Quote
View Public Profile Visit sdcdesign.co.uk's homepage!
 
Reply     « Reply to Popups
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.87984 seconds with 12 queries