Possible Duplicate:
How to tell browser to stay on current window
Can I delay the onclick action of an element. I have an element which calls a function in the onclick event. How do I delay the call to that function? I want to tell the browser to stop two seconds before performing the onclick action.
The element looks like this.
<div id="id01" class="channel" onclick="load_window('http://www.ewtn.com')"><a>EWTN.com</a></div><br/>EWTN television network</div>
If I put a setTimeout inside the load_window function, the browser treats the window.open as a popup and stops it. So I want to put the question a different way. Is there a way to tell the browser to wait before doing the onclick? In the .click of that element I have code that performs other functions.
$('.channel').click(function() {
$(this).addClass("selected");
show_layer();
setInterval("refresh_caption()",300000);
});
I am looking to delay the call to load_window() while still having that action be treated by the browser as a user action.