[英]how can i trigger event when hidden div get focus in jQuery?
In a tabb design If there are multiple hidden div how can i trigger event when hidden div get focus using jquery. 在Tabb设计中,如果存在多个隐藏的div,当使用jQuery获取隐藏的div的焦点时,如何触发事件。 I tried "focus" but thats for form controls. 我尝试了“焦点”,但这就是表单控件。 please suggest 请建议
You could supply a callback to the show()
method, provided you are the one making that call. 您可以向show()
方法提供回调,只要您是进行该调用的人即可。
$('#tab1').show('fast', function(){
// do something now that it is showing
});
It is difficult to focus hidden field. 难以集中隐藏领域。 But I suggest to use opacity as alternative if your existing DIVs code is editable. 但是,如果您现有的DIV代码是可编辑的,我建议使用不透明度作为替代。 You can do it something like this: 您可以这样做:
HTML: HTML:
<div id="hiddendiv" style="height:'200';width:'200'">This is hidden DIV</div>
jQuery: jQuery的:
$('#hiddendiv').stop().animate({ opacity: 0.0 }, 500);
$('#hiddendiv').live('mouseenter', function(){
$('#hiddendiv').stop().animate({ opacity: 1.0 }, 500);
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.