Randy
Randy

Reputation: 21

Delay Javascript Window.open function by 2 seconds

i need to delay poping up this window by 2 seconds, when a user hovers over the link.

function open_window() 
{
new_window = open("http://www.mysite.com","site","width=610,height=510,left=600,top=400");
}


<a href="#" onMouseOver="javascript:open_window();" >Popup</a>

Upvotes: 2

Views: 1530

Answers (1)

user113716
user113716

Reputation: 322492

<a href="#" onMouseOver="setTimeout(open_window,2000);" >Popup</a>

Upvotes: 3

Related Questions