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

jQuery實(shí)現(xiàn)的粘性滾動(dòng)導(dǎo)航欄效果實(shí)例【附源碼下載】

 更新時(shí)間:2017年10月19日 12:04:18   作者:寒意  
這篇文章主要介紹了jQuery實(shí)現(xiàn)的粘性滾動(dòng)導(dǎo)航欄效果,涉及jQuery插件smint的相關(guān)使用技巧,并附帶完整實(shí)例源碼供讀者下載參考,需要的朋友可以參考下

本文實(shí)例講述了jQuery實(shí)現(xiàn)的粘性滾動(dòng)導(dǎo)航欄效果。分享給大家供大家參考,具體如下:

粘性滾動(dòng)是當(dāng)導(dǎo)航在滾動(dòng)過(guò)程中會(huì)占粘于瀏覽器上,達(dá)到方便網(wǎng)站頁(yè)面瀏覽的效果,也是一種用戶體驗(yàn),下面我們看一下是怎么實(shí)現(xiàn)的:

jQuery的 smint插件,也是一個(gè)導(dǎo)航菜單固定插件。當(dāng)頁(yè)滾動(dòng)時(shí),導(dǎo)航菜單會(huì)固定在頂部;當(dāng)點(diǎn)擊菜單時(shí),頁(yè)面會(huì)平滑的滾動(dòng)到對(duì)應(yīng)的區(qū)域。

兼容性

由于 smint 使用了 position: fixed,所以它不兼容 IE6。適用瀏覽器:IE8、360、FireFox、Chrome、Safari、Opera、傲游、搜狗、世界之窗.

引入文件

<link href="css/demo.css" rel="external nofollow" rel="stylesheet" type="text/css">
<script src="js/jquery.min.js"></script>
<script src="js/jquery.smint.js"></script>

HTML

<body onload="setTimeout(function() { window.scrollTo(0, 1) }, 100);">
<div class="wrap">
  <div class="subMenu">
    <div class="inner">
      <a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" id="sTop" class="subNavBtn">Home</a>
      <a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" id="s1" class="subNavBtn">Section 1</a>
      <a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" id="s2" class="subNavBtn">Section 2</a>
      <a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" id="s3" class="subNavBtn">Section 3</a>
      <a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" id="s4" class="subNavBtn">Section 4</a>
      <a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" id="s5" class="subNavBtn end">Section 5</a>
    </div>
  </div>
  <div class="section sTop">
    <div class="inner"></div><br class="clear">
  </div>
  <div class="section s1">
    <div class="inner"><h1>Section 1</h1></div>
  </div>
  <div class="section s2">
    <div class="inner"><h1>Section 2</h1></div>
  </div>
  <div class="section s3">
    <div class="inner"><h1>Section 3</h1></div>
  </div>
  <div class="section s4">
    <div class="inner"><h1>Section 4</h1></div>
  </div>
  <div class="section s5">
    <div class="inner"><h1>Section 5</h1></div>
  </div>
</div>
</body>

注意:菜單的外部容器(如上例的 subMenu)需要設(shè)置樣式 position:absolute,并且每個(gè)菜單的 a 標(biāo)簽需要設(shè)置 id,id 的值與下面對(duì)應(yīng)區(qū)域的 class 的值一致。

JavaScript

$(function() {
  $('.subMenu').smint({
    scrollSpeed : 1000
  });
});

附:完整實(shí)例代碼點(diǎn)擊此處本站下載。

更多關(guān)于jQuery相關(guān)內(nèi)容感興趣的讀者可查看本站專題:《jQuery切換特效與技巧總結(jié)》、《jQuery擴(kuò)展技巧總結(jié)》、《jQuery常用插件及用法總結(jié)》、《jQuery拖拽特效與技巧總結(jié)》、《jQuery常見(jiàn)經(jīng)典特效匯總》、《jQuery動(dòng)畫與特效用法總結(jié)》及《jquery選擇器用法總結(jié)

希望本文所述對(duì)大家jQuery程序設(shè)計(jì)有所幫助。

  • jQuery中before()方法用法實(shí)例

    jQuery中before()方法用法實(shí)例

    這篇文章主要介紹了jQuery中before()方法用法,以實(shí)例形式分析了before()方法的功能、定義與具體使用技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下
    2014-12-12
  • jQuery實(shí)現(xiàn)的選擇商品飛入文本框動(dòng)畫效果完整實(shí)例

    jQuery實(shí)現(xiàn)的選擇商品飛入文本框動(dòng)畫效果完整實(shí)例

    這篇文章主要介紹了jQuery實(shí)現(xiàn)的選擇商品飛入文本框動(dòng)畫效果,結(jié)合完整實(shí)例形式分析了jQuery動(dòng)態(tài)操作頁(yè)面元素屬性實(shí)現(xiàn)動(dòng)畫效果的方法,涉及jQuery的事件綁定、元素遍歷及屬性操作等相關(guān)技巧,需要的朋友可以參考下
    2016-08-08
  • jquery實(shí)現(xiàn)checkbox 全選/全不選的通用寫法

    jquery實(shí)現(xiàn)checkbox 全選/全不選的通用寫法

    本篇文章主要是對(duì)jquery實(shí)現(xiàn)checkbox 全選/全不選的通用寫法進(jìn)行了介紹,需要的朋友可以過(guò)來(lái)參考下,希望對(duì)大家有所幫助
    2014-02-02
  • 頁(yè)面刷新時(shí)記住滾動(dòng)條的位置jquery代碼

    頁(yè)面刷新時(shí)記住滾動(dòng)條的位置jquery代碼

    這篇文章主要介紹了點(diǎn)擊按鈕頁(yè)面刷新的時(shí)候 記住滾動(dòng)條的位置,需要的朋友可以參考下
    2014-06-06
  • jQuery中阻止冒泡事件的方法介紹

    jQuery中阻止冒泡事件的方法介紹

    這篇文章主要介紹了jQuery中阻止冒泡事件的方法介紹,需要的朋友可以參考下
    2014-04-04
  • 認(rèn)識(shí)jQuery的Promise的具體使用方法

    認(rèn)識(shí)jQuery的Promise的具體使用方法

    本篇文章主要介紹了認(rèn)識(shí)jQuery的Promise的具體使用方法,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧
    2017-10-10
  • 7款風(fēng)格新穎的jQuery/CSS3菜單導(dǎo)航分享

    7款風(fēng)格新穎的jQuery/CSS3菜單導(dǎo)航分享

    下面給大家分享7款風(fēng)格新穎的jQuery/CSS3菜單導(dǎo)航讓用戶方便地找到想要的信息,而且更讓人有一種特殊的用戶體驗(yàn),希望大家會(huì)喜歡
    2013-04-04
  • jQuery與Ajax以及序列化

    jQuery與Ajax以及序列化

    本文給大家介紹jQuery與Ajax以及序列化,涉及到ajax的優(yōu)勢(shì),ajax的不足,序列化相關(guān)知識(shí),本文介紹的非常詳細(xì),具有參考借鑒價(jià)值感興趣的朋友一起學(xué)習(xí)吧
    2016-02-02
  • jquery數(shù)組封裝使用方法分享(jquery數(shù)組遍歷)

    jquery數(shù)組封裝使用方法分享(jquery數(shù)組遍歷)

    JQuery對(duì)數(shù)組的處理非常便捷并且功能強(qiáng)大齊全,一步到位的封裝了很多原生js數(shù)組不能企及的功能。下面來(lái)看看JQuery數(shù)組的強(qiáng)大之處在哪。
    2014-03-03
  • 最新評(píng)論

    高要市| 胶州市| 太保市| 固镇县| 广东省| 万州区| 西安市| 德化县| 浙江省| 双鸭山市| 泸西县| 儋州市| 怀化市| 昌乐县| 沅江市| 定陶县| 江阴市| 唐山市| 沈丘县| 大埔县| 衡南县| 梨树县| 洪洞县| 永顺县| 兰溪市| 科技| 云林县| 三门峡市| 黑龙江省| 桐柏县| 沁源县| 开平市| 博客| 仁布县| 内黄县| 勐海县| 社会| 张家港市| 汤阴县| 克拉玛依市| 成都市|