I'm trying to show up a container if a input field gets the focus and - that's the actual problem - hide the container if focus is lost.(我试图在输入字段获得焦点时显示容器 - 这是实际问题 - 如果焦点丢失则隐藏容器。)
Is there an opposite event for jQuery's focus?(是否存在jQuery关注的相反事件?)
Some example code:(一些示例代码:)
<input type="text" value="" name="filter" id="filter"/>
<div id="options">some cool options</div>
<script type="text/javascript">
$('#options').hide();
$('#filter').focus(function() {
$('#options').appear();
});
</script>
And what I'd like to do is something like this:(而我想做的是这样的事情:)
$('#filter').focus_lost(function() {
$('#options').hide();
});
ask by xijo translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…