无为清净楼资源网 Design By www.qnjia.com
本实例使用jquery操作div的CSS,实现了可隐藏重现的靠边悬浮层,预览效果网址:http://www.keleyi.com/keleyi/phtml/xuanfudiv/
本实例使用到jquery添加移除类的两个方法,详细介绍请参考网址:http://www.keleyi.com/a/bjac/e9e40a974de5a902.htm
下面给出完整代码,保存到html文件可查看效果。
复制代码 代码如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>jquery实现的可隐藏重现的靠边悬浮层-</title>
<script type="text/javascript" src="/UploadFiles/2021-04-02/jquery-1.9.1.min.js"><style type="text/css">
body{ margin:0px;}
.onkeleyicom{left:0px;}
.offkeleyicom{left:-140px;}
.showkeleyicom{visibility:visible;}
.hidekeleyicom{visibility:hidden;}
#xf_keleyi_com{width:166px;height:200px; background-color:transparent;position:fixed;top:200px;}
#jt_keleyi_com{float:right;width:25px;height:25px;margin-top:80px;}
#nr_keleyi_com{float:left;height:100%;width:136px;background-color:Silver;}
</style>
</head>
<body>
<div style="background-color:#959822; width:100%;height:150px;">可以滚动鼠标使页面向下</div>
<div style="background-color:Green; width:100%;height:150px;">www.keleyi.com</div>
<div style="background-color:Red; width:100%;height:150px;">请把光标移到箭头上</div>
<div style="background-color:Yellow; width:100%;height:150px;">hi</div>
<div style="background-color:Silver; width:100%;height:150px;">柯乐义</div>
<div style="background-color:Aqua; width:100%;height:150px;">keleyi.com</div>
<div style="background-color:Fuchsia; width:100%;height:150px;">keleyi</div>
<div style="background-color:Green; width:100%;height:150px;">keleyi.com</div>
<div style="background-color:Blue; width:100%;height:150px;">柯乐义</div>
<div style="background-color:Olive; width:100%;height:150px;">柯乐义 jquery实现的可隐藏重现的靠边悬浮层</div>
<div style="background-color:Green; width:100%;height:150px;">A</div>
<div style="background-color:Purple; width:100%;height:150px;">jquery</div>
<div style="background-color:Green; width:100%;height:150px;"><a href="http://www.keleyi.com/a/bjac/cdbc89174171ebb8.htm" target="_blank">原文</a></div>
<div style="background-color:Lime; width:100%;height:150px;">keleyi.com</div>
<div style="background-color:Orange; width:100%;height:150px;"><a href="http://www.keleyi.com/menu/jquery/" target="_blank">jQuery</a>完整代码</div>
<div class="offkeleyicom" id="xf_keleyi_com">
<div id="nr_keleyi_com">这里是内容<br />www.keleyi.com
<ul>
<li><a href="http://www.keleyi.com/menu/net/" target="_blank">.NET</a>
</li>
<li><a href="http://www.keleyi.com/menu/javascript/" target="_blank">Javascript</a>
</li>
<li><a href="http://www.keleyi.com/menu/jquery/" target="_blank">jQuery</a>
</li>
<li><a href="http://www.keleyi.com/menu/csharp/" target="_blank">C#</a>
</li>
<li><a href="http://www.keleyi.com/menu/other/" target="_blank">其他</a>
</li>
</ul>
<br />
</div>
<div id="jt_keleyi_com"><img src="/UploadFiles/2021-04-02/rightarrow.jpg"></div>
<script type="text/javascript">
$(document).ready(
function () {
$('#jt_keleyi_com').bind('mouseover', function () {
$('#xf_keleyi_com').removeClass("offkeleyicom");
$('#xf_keleyi_com').addClass("onkeleyicom");
$('#jt_keleyi_com').addClass("hidekeleyicom");
$('#jt_keleyi_com').removeClass("showkeleyicom");
})
$('#nr_keleyi_com').bind('mouseleave', function () {
$('#xf_keleyi_com').removeClass("onkeleyicom");
$('#xf_keleyi_com').addClass("offkeleyicom");
$('#jt_keleyi_com').removeClass("hidekeleyicom");
$('#jt_keleyi_com').addClass("showkeleyicom");
})
})
</script>
</body>
</html>
本实例使用到jquery添加移除类的两个方法,详细介绍请参考网址:http://www.keleyi.com/a/bjac/e9e40a974de5a902.htm
下面给出完整代码,保存到html文件可查看效果。
复制代码 代码如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>jquery实现的可隐藏重现的靠边悬浮层-</title>
<script type="text/javascript" src="/UploadFiles/2021-04-02/jquery-1.9.1.min.js"><style type="text/css">
body{ margin:0px;}
.onkeleyicom{left:0px;}
.offkeleyicom{left:-140px;}
.showkeleyicom{visibility:visible;}
.hidekeleyicom{visibility:hidden;}
#xf_keleyi_com{width:166px;height:200px; background-color:transparent;position:fixed;top:200px;}
#jt_keleyi_com{float:right;width:25px;height:25px;margin-top:80px;}
#nr_keleyi_com{float:left;height:100%;width:136px;background-color:Silver;}
</style>
</head>
<body>
<div style="background-color:#959822; width:100%;height:150px;">可以滚动鼠标使页面向下</div>
<div style="background-color:Green; width:100%;height:150px;">www.keleyi.com</div>
<div style="background-color:Red; width:100%;height:150px;">请把光标移到箭头上</div>
<div style="background-color:Yellow; width:100%;height:150px;">hi</div>
<div style="background-color:Silver; width:100%;height:150px;">柯乐义</div>
<div style="background-color:Aqua; width:100%;height:150px;">keleyi.com</div>
<div style="background-color:Fuchsia; width:100%;height:150px;">keleyi</div>
<div style="background-color:Green; width:100%;height:150px;">keleyi.com</div>
<div style="background-color:Blue; width:100%;height:150px;">柯乐义</div>
<div style="background-color:Olive; width:100%;height:150px;">柯乐义 jquery实现的可隐藏重现的靠边悬浮层</div>
<div style="background-color:Green; width:100%;height:150px;">A</div>
<div style="background-color:Purple; width:100%;height:150px;">jquery</div>
<div style="background-color:Green; width:100%;height:150px;"><a href="http://www.keleyi.com/a/bjac/cdbc89174171ebb8.htm" target="_blank">原文</a></div>
<div style="background-color:Lime; width:100%;height:150px;">keleyi.com</div>
<div style="background-color:Orange; width:100%;height:150px;"><a href="http://www.keleyi.com/menu/jquery/" target="_blank">jQuery</a>完整代码</div>
<div class="offkeleyicom" id="xf_keleyi_com">
<div id="nr_keleyi_com">这里是内容<br />www.keleyi.com
<ul>
<li><a href="http://www.keleyi.com/menu/net/" target="_blank">.NET</a>
</li>
<li><a href="http://www.keleyi.com/menu/javascript/" target="_blank">Javascript</a>
</li>
<li><a href="http://www.keleyi.com/menu/jquery/" target="_blank">jQuery</a>
</li>
<li><a href="http://www.keleyi.com/menu/csharp/" target="_blank">C#</a>
</li>
<li><a href="http://www.keleyi.com/menu/other/" target="_blank">其他</a>
</li>
</ul>
<br />
</div>
<div id="jt_keleyi_com"><img src="/UploadFiles/2021-04-02/rightarrow.jpg"></div>
<script type="text/javascript">
$(document).ready(
function () {
$('#jt_keleyi_com').bind('mouseover', function () {
$('#xf_keleyi_com').removeClass("offkeleyicom");
$('#xf_keleyi_com').addClass("onkeleyicom");
$('#jt_keleyi_com').addClass("hidekeleyicom");
$('#jt_keleyi_com').removeClass("showkeleyicom");
})
$('#nr_keleyi_com').bind('mouseleave', function () {
$('#xf_keleyi_com').removeClass("onkeleyicom");
$('#xf_keleyi_com').addClass("offkeleyicom");
$('#jt_keleyi_com').removeClass("hidekeleyicom");
$('#jt_keleyi_com').addClass("showkeleyicom");
})
})
</script>
</body>
</html>
标签:
隐藏,重现,悬浮层
无为清净楼资源网 Design By www.qnjia.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
无为清净楼资源网 Design By www.qnjia.com
暂无评论...
更新日志
2024年09月30日
2024年09月30日
- 纪钧瀚《钢琴阅读时光 雨中书店聆听轻音乐》[FLAC/分轨][399.62MB]
- 证声音乐图书馆《走向自然 疗心爵士乐》[320K/MP3][87.4MB]
- 证声音乐图书馆《走向自然 疗心爵士乐》[FLAC/分轨][184.94MB]
- 陈慧娴.2018-Priscilla-Ism演唱会3CD(2024环球红馆40复刻系列)【环球】【WAV+CUE】
- 郑秀文.1999-我应该得到(国)【华纳】【WAV+CUE】
- 陈家慧.2011-钢琴酒吧2CD【龙吟唱片】【WAV+CUE】
- 证声音乐图书馆《雨季 蓝调吉他 Rainy Blues》[320K/MP3][45.01MB]
- 证声音乐图书馆《雨季 蓝调吉他 Rainy Blues》[FLAC/分轨][109.13MB]
- 赞多《序章》[320K/MP3][45.54MB]
- 许巍.2004-每一刻都是崭新的【步升大风】【WAV+CUE】
- 群星.2024-四方馆影视原声带【韶愔音乐】【FLAC分轨】
- 陈雷.1997-安锁咧【金圆唱片】【WAV+CUE】
- 关淑怡.2013-MY.FAVORITE.SK.3CD【环球】【WAV+CUE】
- Sweety.2006-花言乔语【丰华】【WAV+CUE】
- 李恕权.2003-回·20年全精选2CD【SONY】【WAV+CUE】