国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > JavaScript > 正文

jquery實現的可隱藏重現的靠邊懸浮層實例代碼

2019-11-20 22:41:01
字體:
來源:轉載
供稿:網友
本實例使用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="http://www.keleyi.com/keleyi/pmedia/jquery-1.9.1.min.js"></script>
<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 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 target="_blank">jQuery</a>完整代碼</div>
<div class="offkeleyicom" id="xf_keleyi_com">
<div id="nr_keleyi_com">這里是內容<br />www.keleyi.com
<ul>
<li><a target="_blank">.NET</a>
</li>
<li><a target="_blank">Javascript</a>
</li>
<li><a target="_blank">jQuery</a>
</li>
<li><a target="_blank">C#</a>
</li>
<li><a target="_blank">其他</a>
</li>
</ul>
<br />
</div>
<div id="jt_keleyi_com"><img src="http://www.keleyi.com/keleyi/pmedia/rightarrow.jpg" alt="顯示" /></div>
</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>
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 鸡泽县| 札达县| 饶阳县| 万山特区| 泌阳县| 富顺县| 那坡县| 隆安县| 华坪县| 绥芬河市| 寿阳县| 中山市| 新乐市| 承德县| 界首市| 平顶山市| 弋阳县| 栾城县| 武胜县| 新兴县| 收藏| 华蓥市| 盐山县| 仁化县| 金湖县| 九寨沟县| 山东| 繁昌县| 舟曲县| 长兴县| 平阴县| 扎鲁特旗| 彩票| 南郑县| 尖扎县| 安化县| 永年县| 贵德县| 温泉县| 定安县| 逊克县|