Reputation: 12998
I am trying to trigger a click event on hover using jQuery.
This is pretty simple but it would seem I can not trigger the click of an asp.net linkbutton which refreshes the content of an updatepanel using this method.
Here's the code - fairly standard so not sure it will make a difference.
$("a.testbutton").mouseenter( function() {
$(this).trigger('click');
});
Any ideas?
Upvotes: 1
Views: 863
Reputation: 2676
Have you tried
$("a.testbutton").mouseenter( function() {
$(this).click(function(alert();)) //replace alert(); with your refresh function
});
Upvotes: 0
Reputation: 144689
Programmatically triggering click differs from actual click event, try the following.
$("a.testbutton").mouseenter(function() {
window.location.href = this.href
});
Upvotes: 3