当鼠标指针位于元素上方时,会触发 mouseover 事件;当鼠标指针离开元素上方时,会触发 mouseout 事件.
<h2>什么是JQuery</h2>
<div id="content" hidden="true">jQuery的是跨平台的 JavaScript库旨在简化客户端脚本的HTML。
[3]它是免费的开源软件,使用许可的麻省理工学院许可证。
[2] Web分析表明,它是广泛部署的JavaScript库。</div>
</div>js: $("h2").bind("mouseout",function(){
$(this).next().hide();
}); $("h2").bind("mouseover",function(){
$(this).next().show();
});或者:
$("h2").mouseout(function(){
$(this).next().hide();
});
$("h2").mouseover(function(){
$(this).next().show();
});效果:
mouseover:
mouseout:

本文介绍了如何使用jQuery实现鼠标悬停显示隐藏内容的效果,并简要概述了jQuery作为跨平台JavaScript库的基本概念及其特点。
786

被折叠的 条评论
为什么被折叠?



