jQuery實(shí)現(xiàn)可關(guān)閉固定于底(頂)部的工具條菜單效果
本文實(shí)例講述了jQuery實(shí)現(xiàn)可關(guān)閉固定于底(頂)部的工具條菜單效果。分享給大家供大家參考,具體如下:
這是一款可關(guān)閉始終在頁面底部的工具條菜單,浮動(dòng)在頁面頂部的大家見的比較多了,本款從形式上來說與其它的沒什么差別,只是浮動(dòng)在頁面的最底部,帶一關(guān)閉按鈕,一般來說,此效果可用作廣告條、網(wǎng)站提示以及一些需要用戶特別注意的地方。
運(yùn)行效果截圖如下:
在線演示地址如下:
http://demo.jb51.net/js/2015/jquery-fixed-buttom-adv-line-codes/
具體代碼如下:
<!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>固定底(頂)部菜單</title> <script type="text/javascript" src="jquery1.3.2.js"></script> <style> body,h1,h2,h3,h4,h5,h6,p,ul,li,dl,dt,dd{padding:0;margin:0;} li{list-style:none;}img{border:none;}em{font-style:normal;} a{color:#555;text-decoration:none;outline:none;blr:this.onFocus=this.blur();} a:hover{color:#000;text-decoration:underline;} body{font-size:12px;font-family:Arial,Verdana, Helvetica, sans-serif;word-break:break-all;word-wrap:break-word;} .bnav{ text-align:left;height:25px;overflow:hidden;width:98%;line-height:25px;background:#fff; margin:0 1%;border:#B4B4B4 1px solid; border-bottom:none;z-index:999;position:fixed;bottom:0;left:0;_position:absolute;/* for IE6 */_top: expression(documentElement.scrollTop + documentElement.clientHeight-this.offsetHeight); /* for IE6 */ overflow:visible;} .close{position:absolute;right:5px;height:25px;width:16px;text-indent:-9999px;padding-left:10px;} .close a{background:url(images/close.gif) no-repeat center; width:16px;display:block;} .bnav2{height:24px;line-height:24px; margin:1px; margin-bottom:0;background:#E5E5E5; } .bnav .s1{ position:absolute;left:10px;} .bnav .s1 img{ padding-top:3px;margin-right:7px;} .bnav .s2{ position:absolute;right:30px; color:#888;} .bnav .s2 span{ padding-right:10px;} .bnav .s2 a{margin:0 6px;} .rolltext{position:absolute;left:160px;height:25px;line-height:25px; overflow: hidden;} .rolltext dt,.rolltext dd{float:left;width: auto;} .rolltext a{display:block;height:25px;overflow:hidden;} .bnav3{height:25px;width:16px;line-height:25px; margin:0 1%; padding-right:6px;border-bottom:none;z-index:999;position:fixed;bottom:0;right:0;_position:absolute;/* for IE6 */_top: expression(documentElement.scrollTop + documentElement.clientHeight-this.offsetHeight); /* for IE6 */ overflow:visible;} .bnav3 a{background:url(images/open.gif) no-repeat center; display:block;height:25px;width:16px; text-indent:-5000px;} </style> </head> <body> <script type="text/javascript"> var closeBN = $.cookie("bnav"); if (closeBN == "0"){closeNav();} function showNav(){ $(".openClose").toggle(); $.cookie("bnav", "1", {expires: 1}); } function closeNav(){ $(".openClose").toggle(); $.cookie("bnav", "0", {expires: 1}); } // 單行滾動(dòng) function SingleScroll(){ $(".rolltext dd").animate({marginTop:"-25px"},500,function(){ $(this).css({marginTop:"0px"}).find("a:first").appendTo(this); }); } $(document).ready(function(){ setInterval("SingleScroll()",3000); }); </script> <div class="bnav openClose"> <div class="bnav2"> <span class="s1"> <a href="#"><img src="images/qqonline.gif"></a><a href="#"><img src="images/qqonline2.gif"></a> </span> <dl class="rolltext"> <dt>特別聲明:</dt> <dd> <a href="#">慶雙節(jié)期間,商城有專人值班,請上帝們放心購物</a> <a href="#">天悅所售手機(jī)為大陸行貨、全國聯(lián)保商品</a> <a href="#">部分少量港行、歐行機(jī)器我們都已特別注明</a> <a href="#">請上帝們就不要再咨詢同類問題啦,客服電話要爆嘍</a> </dd> </dl> <span class="s2"> <span><a href="#">[登錄]</a><a href="#">[免費(fèi)注冊]</a></span><a href="#">購物車</a>|<a href="#">幫助中心</a>|<a href="#">在線留言</a> </span> <span class="close"><a href="javascript:void(0)" onclick="closeNav()" title="關(guān)閉">關(guān)閉</a></span> </div> </div> <div class="bnav3 openClose" style="display:none;"><a href="javascript:void(0)" onclick="showNav()" title="打開">打開</a></div> </body> </html>
希望本文所述對大家jQuery程序設(shè)計(jì)有所幫助。
- jQuery實(shí)現(xiàn)可高亮顯示的二級(jí)CSS菜單效果
- 基于jquery實(shí)現(xiàn)導(dǎo)航菜單高亮顯示(兩種方法)
- jQuery實(shí)現(xiàn)點(diǎn)擊后標(biāo)記當(dāng)前菜單位置(背景高亮菜單)效果
- jQuery+CSS3實(shí)現(xiàn)仿花瓣網(wǎng)固定頂部位置帶懸浮效果的導(dǎo)航菜單
- jQuery實(shí)現(xiàn)固定在網(wǎng)頁頂部的菜單效果代碼
- jquery固定底網(wǎng)站底部菜單效果
- jQuery 菜單隨滾條改為以定位方式(固定要瀏覽器頂部)
- jQuery實(shí)現(xiàn)帶延時(shí)功能的水平多級(jí)菜單效果【附demo源碼下載】
- jQuery實(shí)現(xiàn)點(diǎn)擊后高亮背景固定顯示的菜單效果【附demo源碼下載】
相關(guān)文章
jquery.hotkeys監(jiān)聽鍵盤按下事件keydown插件
jquery.hotkeys就是網(wǎng)頁是監(jiān)聽用戶按鍵要用到的jquery庫,這里簡單介紹下使用方法,需要的朋友可以參考下2014-05-05用jQuery.ajaxSetup實(shí)現(xiàn)對請求和響應(yīng)數(shù)據(jù)的過濾
本文主要對用jQuery.ajaxSetup實(shí)現(xiàn)對請求和響應(yīng)數(shù)據(jù)的過濾的過程與方法進(jìn)行詳細(xì)全面的實(shí)例講解。具有很好的參考價(jià)值,需要的朋友一起來看下吧2016-12-12jQuery插件Skippr實(shí)現(xiàn)焦點(diǎn)圖幻燈片特效
Skippr 是一個(gè)超級(jí)簡單的 jQuery 幻燈片插件。只是包括你的網(wǎng)頁中引入 jquery.skippr.css 和 jquery.skippr.js 文件就能使用了。Skippr 能夠自適應(yīng)窗口寬度,而且導(dǎo)航是獨(dú)特的條形導(dǎo)航。2015-04-04jQuery使用$.ajax進(jìn)行即時(shí)驗(yàn)證實(shí)例詳解
這篇文章主要介紹了jQuery使用$.ajax進(jìn)行即時(shí)驗(yàn)證的方法,以完整實(shí)例形式較為詳細(xì)的分析了jQuery前臺(tái)控制ajax交互與后臺(tái)asp.net響應(yīng)處理的詳細(xì)實(shí)現(xiàn)技巧,需要的朋友可以參考下2015-12-12jquery操作checkbox的常用方法總結(jié)【附測試源碼下載】
這篇文章主要介紹了jquery操作checkbox的常用方法,結(jié)合完整實(shí)例形式總結(jié)分析了jQuery使用checkbox全選、取消、反選等常見操作技巧,并附帶測試源碼供讀者下載參考,需要的朋友可以參考下2019-06-06簡單實(shí)現(xiàn)jQuery上傳圖片顯示預(yù)覽功能
這篇文章主要教大家如何簡單實(shí)現(xiàn)jQuery上傳圖片顯示預(yù)覽功能,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-08-08easyui combotree加載靜態(tài)數(shù)據(jù)問題(選不上)解決方法
這篇文章主要介紹了easyui combotree加載靜態(tài)數(shù)據(jù)問題,選不上)2016-12-12