[英]Trigger the click event of asp.net linkbutton on mouseenter using jQuery
I am trying to trigger a click event on hover using jQuery. 我试图使用jQuery在悬停时触发click事件。
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. 这很简单,但似乎我无法触发使用此方法刷新updatepanel内容的asp.net linkbutton的点击。
Here's the code - fairly standard so not sure it will make a difference. 这是代码 - 相当标准,所以不确定它会有所作为。
$("a.testbutton").mouseenter( function() {
$(this).trigger('click');
});
Any ideas? 有任何想法吗?
Programmatically triggering click differs from actual click event, try the following. 以编程方式触发点击与实际点击事件不同,请尝试以下操作。
$("a.testbutton").mouseenter(function() {
window.location.href = this.href
});
Have you tried 你有没有尝试过
$("a.testbutton").mouseenter( function() {
$(this).click(function(alert();)) //replace alert(); with your refresh function
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.