tags:

views:

61

answers:

2

Hi,

I have a bit of a little popup warning thing, and I'd like it to appear after 5 seconds as oppose to right away. All it is is direct html. Anyone know how to do it?

Thanks

edit: it's not actually a popup, it just comes up and shows the user a message about their account. And it's needed because it takes 5 seconds for part of it to load, and it doesn't function properly if it's clicked / used by the user within 5 seconds of showing up

A: 

How about using jQuery, specifically .delay() and .fadeIn()?

Forgotten Semicolon
+4  A: 

First, you should consider if you really want to do this - given the rise of popup blockers and the association of popups with dirty rotten advertisements, people are generally negatively predisposed to popups, if their browser even displays them.

But, if you really want to do it, you need to run some javascript:

<script type="text/javascript">
setTimeout(
    function() {
        window.open('linkToYourPopup.htm', 'popupWindow', 'width=400,height=200,scrollbars=no');
    }, 5 * 1000); // 5 * 1000 = 5000 milliseconds = 5 seconds
</script>
Dexter
+1 for setTimeout, you could also replace window.open with just alert() if it is a "simple message" and not run foul of popup blockers.
David