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.
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..