jQuery實(shí)現(xiàn)的個(gè)性化返回底部與返回頂部特效代碼
本文實(shí)例講述了jQuery實(shí)現(xiàn)的個(gè)性化返回底部與返回頂部特效代碼。分享給大家供大家參考,具體如下:
運(yùn)用了所學(xué)習(xí)的jQuery特性,制作了這款效果,該效果集結(jié)了返回底部、返回頂部、網(wǎng)站留言導(dǎo)航三種功能,網(wǎng)站留言的鏈接你可以修改為任意一個(gè)您想導(dǎo)航的鏈接,這個(gè)可以靈活運(yùn)用了。本款效果的亮點(diǎn)在于兼容性和動(dòng)畫(huà)效果,以及設(shè)計(jì)美觀的箭頭等。
運(yùn)行效果截圖如下:
在線演示地址如下:
http://demo.jb51.net/js/2015/jquery-back-top-buttom-style-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> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>特效加工廠</title> <script type="text/javascript" src="jquery-1.6.2.min.js"></script> <style type="text/css"> body { margin:0; padding:0; font-size:12px; } #main { width:910px; margin:0 auto; height:2000px; } .go{width:47px;height:106px;position:fixed;_position:absolute;_top:expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-this.offsetHeight-(parseInt(this.currentStyle.marginTop,10)||200)-(parseInt(this.currentStyle.marginBottom,10)||0)));right:12px;bottom:25%; background-image:url("images/tobg.png"); background-repeat:no-repeat;} .go a{background:url(images/a.png) no-repeat;display:block;text-indent:999em;width:37px;margin:5px;border:0;overflow:hidden;float:left; cursor:pointer;} .go .top{background-position:0 0px;height:22px} .go .feedback{background-position:0 -22px;height:32px} .go .bottom{background-position:0 -55px;height:22px} .go .top:hover{background-position:-38px -0px} .go .feedback:hover{background-position:-38px -22px} .go .bottom:hover{background-position:-38px -55px} </style> <script type="text/javascript"> $(function () { $(".top").click(//定義返回頂部點(diǎn)擊向上滾動(dòng)的動(dòng)畫(huà) function () { $('html,body').animate({ scrollTop: 0 }, 700); }); $(".bottom").click(//定義返回頂部點(diǎn)擊向上滾動(dòng)的動(dòng)畫(huà) function () { $('html,body').animate({ scrollTop: document.body.clientHeight }, 700); }); }) </script> </head> <body> <div id="main"> <div class="go"> <a title="返回頂部" class="top"></a> <a title="如果您有意見(jiàn),請(qǐng)反饋給我們!" class="feedback" href="#" target="_blank"></a> <a title="返回底部" class="bottom" ></a> </div> </div> </body> </html>
希望本文所述對(duì)大家jQuery程序設(shè)計(jì)有所幫助。
- jquery實(shí)現(xiàn)頁(yè)面常用的返回頂部效果
- jQuery實(shí)現(xiàn)返回頂部功能
- 基于jQuery實(shí)現(xiàn)返回頂部實(shí)例代碼
- jquery小火箭返回頂部代碼分享
- jQuery實(shí)現(xiàn)返回頂部效果的方法
- 使用jQuery實(shí)現(xiàn)返回頂部
- jquery 實(shí)現(xiàn)返回頂部功能
- jQuery實(shí)現(xiàn)返回頂部功能適合不支持js的瀏覽器
- 用jQuery實(shí)現(xiàn)的智能隱藏、滑動(dòng)效果的返回頂部代碼
- 一句jQuery代碼實(shí)現(xiàn)返回頂部效果(簡(jiǎn)單實(shí)用)
相關(guān)文章
jQuery Easyui datagrid editor為combobox時(shí)指定數(shù)據(jù)源實(shí)例
當(dāng)在datagrid行內(nèi)部應(yīng)用添加編輯操作時(shí),引入combobox是非常方便的操作,這篇文章主要介紹了jQuery Easyui datagrid editor為combobox時(shí)指定數(shù)據(jù)源實(shí)例,有興趣的可以了解一下。2016-12-12jQuery用noConflict代替$的實(shí)現(xiàn)方法
下面小編就為大家?guī)?lái)一篇jQuery用noConflict代替$的實(shí)現(xiàn)方法。小編覺(jué)得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2017-04-04jQuery使用animate創(chuàng)建動(dòng)畫(huà)用法實(shí)例
這篇文章主要介紹了jQuery使用animate創(chuàng)建動(dòng)畫(huà)用法,可實(shí)現(xiàn)點(diǎn)擊鏈接文字隱藏及顯示文字的功能,實(shí)例分析了jquery中toggle與animate方法的使用技巧,需要的朋友可以參考下2015-08-08jQuery Uploadify 上傳插件出現(xiàn)Http Error 302 錯(cuò)誤的解決辦法
本文給大家介紹jQuery Uploadify 上傳插件出現(xiàn)Http Error 302 錯(cuò)誤的解決辦法,涉及到uploadify上傳錯(cuò)誤302相關(guān)問(wèn)題,對(duì)本文感興趣的朋友一起看看吧2015-12-12基于JQuery的訪問(wèn)WebService的代碼(可訪問(wèn)Java[Xfire])
最近有些時(shí)間學(xué)習(xí)了下JQuery,發(fā)現(xiàn)有很多JQuery訪問(wèn).net WebService的例子。作為WebService這種接口應(yīng)該是通用的,為什么沒(méi)人關(guān)于Java的例子呢?這點(diǎn)引起我的興趣。2010-11-11jQuery實(shí)現(xiàn)的fixedMenu下拉菜單效果代碼
這篇文章主要介紹了jQuery實(shí)現(xiàn)的fixedMenu下拉菜單效果代碼,通過(guò)自定義fixedMenu方法實(shí)現(xiàn)點(diǎn)擊下拉菜單效果,具有一定參考借鑒價(jià)值,需要的朋友可以參考下2015-08-08