最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

jQuery實(shí)現(xiàn)的個(gè)性化返回底部與返回頂部特效代碼

 更新時(shí)間:2015年10月30日 10:13:10   作者:企鵝  
這篇文章主要介紹了jQuery實(shí)現(xiàn)的個(gè)性化返回底部與返回頂部特效代碼,涉及jQuery結(jié)合動(dòng)畫(huà)函數(shù)響應(yīng)鼠標(biāo)事件動(dòng)態(tài)改變頁(yè)面元素樣式的相關(guān)技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下

本文實(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ì)美觀(guān)的箭頭等。

運(yùn)行效果截圖如下:

在線(xià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>特效加工廠(chǎng)</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ì)有所幫助。

相關(guān)文章

最新評(píng)論

沅陵县| 清丰县| 南江县| 吉水县| 阿拉尔市| 元朗区| 农安县| 太仓市| 安化县| 巴东县| 深泽县| 莫力| 康马县| 玛多县| 昌吉市| 门头沟区| 晴隆县| 安西县| 勐海县| 水城县| 湖南省| 社会| 上思县| 孙吴县| 丰台区| 万宁市| 左云县| 民县| 白朗县| 明溪县| 博湖县| 巴林左旗| 若尔盖县| 永顺县| 施秉县| 桃园市| 伊金霍洛旗| 建瓯市| 汉中市| 石景山区| 金平|