1. 程式人生 > >jquery固定在頂部的導航選單

jquery固定在頂部的導航選單

<!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>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>jquery導航置頂 - HoverTree</title><
base target="_blank" /> <link href="http://hovertree.com/texiao/jquery/6/css/base.css" rel="stylesheet" type="text/css" /> <link href="http://hovertree.com/texiao/jquery/6/css/html5s.css" rel="stylesheet" type="text/css" /> <script src="http://hovertree.com/ziyuan/jquery/jquery-1.11.3.min.js"></script
> <style> body{text-align:center;} .nav-wrap{} /* Clearfix */ .group:after{visibility:hidden;display:block;content:"";clear:both;height:0} *:first-child+html .group{zoom:1} /* IE7 */ /* Example One */ #example-one{margin:0 auto;list-style:none;position:relative;} #example-one li{display:inline-block
; line-height: 35px;} #example-one a{color:#5D5D5D;font-size:16px;float:left;padding:0px 20px 15px 20px; margin-top:-3px;text-decoration:none;text-transform:uppercase} #example-one a:hover{color: black;} #magic-line{position:absolute;bottom:-2px;left:0;width:100px;height:2px;background:#FF0000} .current_page_item a{} .ie6 #example-one li, .ie7 #example-one li{display:inline} .ie6 #magic-line {bottom:-3px} /**右邊滑動**/ .relativeall{position: fixed; right: 10px; bottom: 300px; width: 50px; height: 26px; text-align: center; border-radius: 2px; z-index: 100;} .relativealls{position: relative;display: block;cursor: pointer;background-color: rgba(0,0,0,0.5);width: 100%;height: 40px;padding: 4px;border-bottom: 1px solid rgba(255,255,255,0.1);} .relativeall-img{position: absolute; display: none; right: 80px; bottom: 0;} .relativealls-top{background-color: #000;opacity: 0.5;padding: 4px;bottom: 180px;height: 40px;cursor: pointer; position: fixed;right: 2px;width: 50px;text-align: center;z-index: 100;} </style> </head> <body style="position: relative;"> <script> $(document).ready(function(){ $(".relativealls").hover(function(){ $(this).css("background","rgba(0,0,0,0.6)"); $(this).find(".relativeall-img").fadeIn(500); },function(){ $(this).css("background","rgba(0,0,0,0.5)"); $(this).find(".relativeall-img").fadeOut(500); }); $(".relativealls-top").hover(function(){ $(this).css("opacity","0.6"); },function(){ $(this).css("opacity","0.5"); }); $(".imgclicks").live("click",function(){ $("html,body").animate({scrollTop:0}); }); }); </script> <div id="maintop"> <div class="tops"> <div class="maintop" style="margin:0px auto"> <div class="logo2"><a href="http://keleyi.com/"><img style="height:48px" src="http://keleyi.com/images/logo.gif" /></a></div> <div class="tops-center"> <div class="nav-wrap"> <ul class="" id="example-one"> <li class="current_page_item"> <a href="http://hovertree.com/">首頁</a></li> <li id="jpjsw"> <a href="http://hovertree.com/shortanswer/bjae/7bd72acca3206862.htm">產品介紹</a></li> <li id="solutions"> <a href="http://hovertree.com/menu/csharp/">網際網路+</a> </li> <li> <a href="http://hovertree.com">商城模板</a></li> <li> <a href="http://keleyi.com/a/bjae/bnco7hj3.htm">手機端</a></li> <li> <a target="_blank" href="http://keleyi.com/keleyi/phtml/">定製商城</a></li> <li style="width: 72px; left: 0px; overflow: hidden;" id="magic-line"></li></ul> </div> <div class="cpjs" id="jpjs" style="display: none;"> <ul> <li><a href="http://tool.keleyi.com/">B2C獨立商城系統</a></li> <li><a href="http://hovertree.com">多使用者商城系統</a></li> <li><a href="http://hovertree.com/hvtart/bjae/i1qo2kg6.htm">微分銷商城系統</a></li> <li><a href="http://hovertree.com">連鎖百貨商城系統</a></li> <li><a href="http://hovertree.com/guestbook/">樂雲派電商 ERP</a></li> </ul> </div> <div class="soluion" id="solu" style="display:none"> <dl> <dt>業務解決方案:</dt> <dd><a href="http://hovertree.com/hvtart/bjae/nh0pk7kc.htm">O2O電商解決方案</a></dd> <dd><a href="http://hovertree.com">多商戶平臺解決方案</a></dd> <dd><a href="http://hovertree.com/hvtart/bjae/akln9gw2.htm">全渠道營銷解決方案</a></dd> <dd><a href="http://hovertree.com"> B2B經銷商報貨解決方案</a></dd> <dd><a href="http://hovertree.com/hvtimg/"> IPTV電視購物解決方案</a></dd> </dl> <dl> <dt>柯樂義:</dt> <dd><a href="http://keleyi.com/a/bjae/sn78qmtf.htm">家居行業解決方案</a></dd> <dd><a href="http://keleyi.com/ziliao/googlejavascriptstyle.htm">生鮮行業解決方案</a></dd> <dd><a href="http://hovertree.com/hvtart/bjae/7xlu0jc6.htm">原文</a></dd> <dd><a href="http://hovertree.com/shortanswer/"> 數碼家電行業解決方案</a></dd> <dd><a href="http://hovertree.com"> 網際網路金融行業解決方案</a></dd> </dl> </div> </div> <script> $("#solutions").hover(function(){ $("#solu").css("display","block"); },function(){ $("#solu").css("display","none"); }); $("#solu").hover(function(){ $("#solu").css("display","block"); },function(){ $("#solu").css("display","none"); }); $("#jpjsw").hover(function(){ $("#jpjs").css("display","block"); },function(){ $("#jpjs").css("display","none"); }); $("#jpjs").hover(function(){ $("#jpjs").css("display","block"); },function(){ $("#jpjs").css("display","none"); }); </script> </div> </div> </div> <p>&nbsp; http://keleyi.com ------------柯樂義</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>請滾動滑鼠輪</p> <p>&nbsp;</p> <p>&nbsp; http://keleyi.com/ ------------柯樂義</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp; http://keleyi.com/ ------------柯樂義</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp; http://keleyi.com/ ------------柯樂義</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</