欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

JQuery實(shí)現(xiàn)鼠標(biāo)滾輪滑動(dòng)到頁面節(jié)點(diǎn)

 更新時(shí)間:2015年07月28日 10:44:41   作者:拎壺充  
這篇文章主要介紹了使用JQuery實(shí)現(xiàn)鼠標(biāo)滾輪滑動(dòng)到頁面節(jié)點(diǎn)的代碼,需要的朋友可以參考下

下面通過一段JQuery代碼實(shí)現(xiàn)鼠標(biāo)滾輪滑動(dòng)到頁面節(jié)點(diǎn)的詳細(xì)介紹,并通過展示效果圖展示給大家。

基于jQuery鼠標(biāo)滾輪滑動(dòng)到頁面節(jié)點(diǎn)部分。這是一款基于jQuery+CSS3實(shí)現(xiàn)的使用鼠標(biāo)滾輪或者手勢(shì)滑動(dòng)到頁面節(jié)點(diǎn)部分特效。效果圖如下:

實(shí)現(xiàn)的代碼。

html代碼:

<section class="panel home" data-section-name="home">
    <div class="inner">
      <header>
        <h1></h1>
        <p class="tagline">適用瀏覽器:360、FireFox、Chrome、Safari、Opera、傲游、搜狗、世界之窗.<br><br>不支持IE8及以下瀏覽器。<br><br><br></p>
      </header>
      <div style="text-algin:center;margin:10px auto">
      <script src="/js/ad_js/bd_76090.js" type="text/javascript"></script></div><br />
      <a href="#overview" class="scroll">滑動(dòng)鼠標(biāo)滾輪</a>

    </div>
  </section>
  <section class="panel overview" data-section-name="overview">
    <div class="inner">
      <h2>基本使用</h2>
      <p>需要引入 jQuery 1.6+ 以及緩沖動(dòng)畫插件jquery.easing.js.</p>
      <pre>
  &lt;! doctype html&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;script&gt;
        $(function() {
          $.scrollify({
            section : "section",
          });
        });
      &lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;section&gt;&lt;/section&gt;
      &lt;section&gt;&lt;/section&gt;
    &lt;/body&gt;
  &lt;/html&gt;
        </pre>
    </div>
  </section>
  <section class="panel configuration" data-section-name="configuration">
    <div class="inner">
      <h2>配置</h2>
      <pre>
  $.scrollify({
    section : "section",
    sectionName : "section-name",
    easing: "easeOutExpo",
    scrollSpeed: 1100,
    offset : 0,
    scrollbars: true,
    before:function() {},
    after:function() {}
  });
        </pre>
    </div>
  </section>
  <section class="panel options" data-section-name="options">
    <div class="inner">
      <h2>選項(xiàng)設(shè)置</h2>
      <dl>
        <dt>section</dt>
        <dd>節(jié)點(diǎn)部分選擇器.</dd>
        <dt>sectionName</dt>
        <dd>每一個(gè)section節(jié)點(diǎn)對(duì)應(yīng)的data屬性.</dd>
        <dt>easing</dt>
        <dd>定義緩沖動(dòng)畫.</dd>
        <dt>offset</dt>
        <dd>定義每個(gè)色彩tion節(jié)點(diǎn)的偏移量.</dd>
        <dt>scrollbars</dt>
        <dd>是否顯示滾動(dòng)條.</dd>
        <dt>before</dt>
        <dd>回調(diào)函數(shù),滾動(dòng)開始前觸發(fā).</dd>
        <dt>after</dt>
        <dd>回調(diào)函數(shù),滾動(dòng)完成后觸發(fā).</dd>
      </dl>
    </div>
  </section>
  <section class="panel methods" data-section-name="methods">
    <div class="inner">
      <h2>方法</h2>
      <p>滑動(dòng)到指定的節(jié)點(diǎn)。</p>
      <pre>
  $.scrollify("move","#name");
        </pre>
      <div style="text-algin:center;margin:10px auto">
        <script src="/js/ad_js/bd_76090.js" type="text/javascript"></script>
      </div><br />
    </div>
  </section>

js代碼:

$(function () {
      $(".panel").css({ "height": $(window).height() });
      var timer;

      $(window).resize(function () {
        clearTimeout(timer);
        timer = setTimeout(function () {
          $(".panel").css({ "height": $(window).height() });
        }, 40);
      });

      $.scrollify({
        section: ".panel"
      });


      $(".scroll").click(function (e) {
        e.preventDefault();
        $.scrollify("move", $(this).attr("href"));
      });
    });

以上代碼就是應(yīng)用JQuery實(shí)現(xiàn)鼠標(biāo)滾輪滑動(dòng)到頁面節(jié)點(diǎn)的全部內(nèi)容,希望對(duì)大家在今后的項(xiàng)目過程中有所幫助。

相關(guān)文章

最新評(píng)論