点我
我是内容
<script><br />
$(document).ready(function(){<br />
jQuery.focusShow({butID:'#button',divID:'#div',mouse:'over',time:'500'})<br />
})<br />
jQuery.extend({<br />
focusShow: function(config){<br />
//ps:焦点控制图层展示,延迟隐藏<br />
//focusShow({butID:'按钮ID',divID:'容器ID',mouse:'over || click',time:'时间'})<br />
var butID = $(config.butID || false),<br />
divID = $(config.divID || false),<br />
mouse = config.mouse || 'click',<br />
time = config.time || '500',<br />
timer;<br />
function re(){$(divID).hide()}<br />
switch (mouse){<br />
case "click":<br />
butID.bind({'click':function(){divID.attr('tabindex','-1');divID.focus()}});<br />
divID.bind({<br />
"focus":function(){clearTimeout(timer);divID.show()},<br />
"blur":function(){timer = setTimeout(re,time)}<br />
})<br />
break<br />
case "over":<br />
$(butID,divID).each(function(){<br />
$(this).bind({<br />
'mouseover':function(){clearTimeout(timer);divID.show()},<br />
'mouseout':function(){timer = setTimeout(re,time)}<br />
})<br />
})<br />
break<br />
default:<br />
}<br />
}<br />
}); <br />
</script>