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

js實(shí)現(xiàn)常見的工具條效果

 更新時(shí)間:2017年03月02日 09:19:38   作者:ywhluck  
本文主要介紹了js實(shí)現(xiàn)常見的工具條效果的實(shí)例。具有很好的參考價(jià)值,下面跟著小編一起來看下吧

實(shí)現(xiàn)功能如下:

1. 二維碼展示功能;

2. “回到頂部”功能。(選擇“全屏預(yù)覽”,滑動(dòng)滾動(dòng)條,查看回到頂部功能)

效果圖:

圖(1) 初始效果

圖(2) 鼠標(biāo)懸浮效果

實(shí)例代碼:

<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<title>工具條</title>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<style type="text/css">
 body{
 background-color:#69C;
 }
 .toolbar{
 position:fixed;
 left:50%;
 bottom:5px;
 margin-left:-26px;
 }
 .toolbar-item{
 position:relative;
 display:block;
 width:52px;
 height:52px;
 background-image:url(http://cdn.attach.qdfuns.com/notes/pics/201703/01/160208u95waa2sfwt27hwh.png);
 background-repeat:no-repeat;
 margin-top:1px;
 -webkit-transition:background-position 1s;
 -moz-transition:background-position 1s;
 -ms-transition:background-position 1s;
 -o-transition:background-position 1s;
 transition:background-position 1s;
 }
 .toolbar-item-wenxin{
 background-position:0 -798px;
 }
 .toolbar-item-wenxin:hover{
 background-position:0 -860px;
 }
 .toolbar-item-feedback{
 background-position:0 -426px;
 }
 .toolbar-item-feedback:hover{
 background-position:0 -488px;
 }
 .toolbar-item-app{
 background-position:0 -550px;
 }
 .toolbar-item-app:hover{
 background-position:0 -612px;
 }
 .toolbar-item-top{
 background-position:0 -674px;
 }
 .toolbar-item-top:hover{
 background-position:0 -736px;
 }
 .toolbar-layer{
 position:absolute;
 right:46px;
 bottom:-10px;
 width:172px;
 background-image:url(http://cdn.attach.qdfuns.com/notes/pics/201703/01/160208u95waa2sfwt27hwh.png);
 background-repeat:no-repeat;
 opacity:0;
 filter:alpha(opacity=0);
 -webkit-transform-origin:95% 95%;
 -moz-transition-origin:95% 95%;
 -ms-transition-origin:95% 95%;
 -o-transition-origin:95% 95%;
 transform-origin:95% 95%;
 -webkit-transition:scale(0.01);
 -moz-transition:scale(0.01);
 -ms-transition:scale(0.01);
 -o-transition:scale(0.01);
 transform:scale(0.01);
 -webkit-transition:all 1s;
 -moz-transition:all 1s;
 -ms-transition:all 1s;
 -o-transition:all 1s;
 transition:all 1s;
 }
 .toolbar-item-wenxin .toolbar-layer{
 height:212px;
 background-position:0 0;
 }
 .toolbar-item-app .toolbar-layer{
 height:194px;
 background-position:0 -222px;
 }
 .toolbar-item:hover .toolbar-layer{
 opacity:1;
 filter:alpha(opacity=100);
 -webkit-transition:scale(1);
 -moz-transition:scale(1);
 -ms-transition:scale(1);
 -o-transition:scale(1);
 transform:scale(1);
 }
</style>
<script type="text/javascript">
 $(window).on('load',function(){
 $('#backTop').on('click',go);
 $(window).on('scroll',function(){
  checkPosition($(window).height());
 }); 
 checkPosition($(window).height());//防止剛開始刷新頁面,返回頂部沒有隱藏的問題,先讓它執(zhí)行一次,使其fadeOut
 })
 //到達(dá)頂部
 function go(){
 $('html,body').scrollTop(0);
 }
 //檢測位置
 function checkPosition(pos){
 if($(window).scrollTop() > pos){
  $('#backTop').fadeIn();//滾動(dòng)超過一個(gè)屏的寬度,就顯示
 }else{
  $('#backTop').fadeOut();
 }
 }
</script>
</head>
<body>
  <div class="toolbar">
    <a href="javascript:;" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="toolbar-item toolbar-item-wenxin">
      <span class="toolbar-layer"></span>
    </a>
    <a href="javascript:;" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="toolbar-item toolbar-item-feedback"></a>
    <a href="javascript:;" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="toolbar-item toolbar-item-app">
      <span class="toolbar-layer"></span>
    </a>
    <a id="backTop" href="javascript:;" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="toolbar-item toolbar-item-top">
    </a>
  </div>
  <!--出現(xiàn)滾動(dòng)條-->
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
  <p>1</p>
</body>
</html>

以上就是本文的全部內(nèi)容,希望本文的內(nèi)容對大家的學(xué)習(xí)或者工作能帶來一定的幫助,同時(shí)也希望多多支持腳本之家!

相關(guān)文章

  • 一篇文章掌握RequireJS常用知識(shí)

    一篇文章掌握RequireJS常用知識(shí)

    一篇文章掌握RequireJS常用知識(shí),通過本文,你可以對模塊化開發(fā)和AMD規(guī)范有一個(gè)較直觀的認(rèn)識(shí),并詳細(xì)地學(xué)習(xí)RequireJS這個(gè)模塊化開發(fā)工具的常見用法,感興趣的小伙伴們可以參考一下
    2016-01-01
  • 微信小程序之圓形進(jìn)度條實(shí)現(xiàn)思路

    微信小程序之圓形進(jìn)度條實(shí)現(xiàn)思路

    這篇文章主要介紹了微信小程序之圓形進(jìn)度條實(shí)現(xiàn)思路,非常不錯(cuò),具有參考借鑒價(jià)值,需要的朋友可以參考下
    2018-02-02
  • JavaScript版經(jīng)典游戲之掃雷游戲完整示例【附demo源碼下載】

    JavaScript版經(jīng)典游戲之掃雷游戲完整示例【附demo源碼下載】

    這篇文章主要介紹了JavaScript版經(jīng)典游戲之掃雷游戲?qū)崿F(xiàn)方法,結(jié)合完整實(shí)例形式分析了掃雷游戲的原理與具體實(shí)現(xiàn)流程,并附帶demo源碼供讀者下載參考,需要的朋友可以參考下
    2016-12-12
  • Javascript實(shí)現(xiàn)單例模式

    Javascript實(shí)現(xiàn)單例模式

    單例模式也稱作為單子模式,更多的也叫做單體模式。為軟件設(shè)計(jì)中較為簡單但是最為常用的一種設(shè)計(jì)模式。這篇文章主要介紹了Javascript實(shí)現(xiàn)單例模式的相關(guān)資料,需要的朋友可以參考下
    2016-01-01
  • confirm確認(rèn)對話框的實(shí)現(xiàn)方法總結(jié)

    confirm確認(rèn)對話框的實(shí)現(xiàn)方法總結(jié)

    下面小編就為大家?guī)硪黄猚onfirm確認(rèn)對話框的實(shí)現(xiàn)方法總結(jié)。小編覺得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧
    2016-06-06
  • js單向鏈表的具體實(shí)現(xiàn)實(shí)例

    js單向鏈表的具體實(shí)現(xiàn)實(shí)例

    js單向鏈表的具體實(shí)現(xiàn)實(shí)例,可以排序,增加,查找,刪除的單向鏈表,需要的朋友可以參考一下
    2013-06-06
  • webpack多入口多出口的實(shí)現(xiàn)方法

    webpack多入口多出口的實(shí)現(xiàn)方法

    這篇文章主要介紹了webpack多入口多出口的實(shí)現(xiàn)方法,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧
    2018-08-08
  • JavaScript常見打開鏈接的幾種方法小結(jié)

    JavaScript常見打開鏈接的幾種方法小結(jié)

    在頁面中的鏈接除了常規(guī)的方式以外,如果使用javascript,還有很多種方式,下面這篇文章主要給大家介紹了關(guān)于JavaScript常見打開鏈接的幾種方法,需要的朋友可以參考下
    2024-01-01
  • 淺談JavaScript中運(yùn)算符的優(yōu)先級(jí)

    淺談JavaScript中運(yùn)算符的優(yōu)先級(jí)

    這篇文章主要給大家簡單介紹了JavaScript中運(yùn)算符的優(yōu)先級(jí)的相關(guān)問題,十分的實(shí)用,有需要的小伙伴可以參考下。
    2015-07-07
  • 詳解js中l(wèi)et與var聲明變量的區(qū)別

    詳解js中l(wèi)et與var聲明變量的區(qū)別

    這篇文章主要介紹了let與var聲明變量區(qū)別,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2019-05-05

最新評(píng)論

荥阳市| 山西省| 托克逊县| 嵊泗县| 大新县| 固阳县| 绵竹市| 怀来县| 托克逊县| 博乐市| 嘉定区| 盐边县| 北川| 望江县| 呼和浩特市| 夏邑县| 拉孜县| 渭源县| 临漳县| 尚义县| 眉山市| 金川县| 子洲县| 离岛区| 中超| 阳江市| 临朐县| 阜阳市| 桑日县| 道孚县| 和顺县| 疏附县| 遵义市| 桂东县| 盖州市| 理塘县| 西贡区| 双鸭山市| 永吉县| 普定县| 新源县|