2016-12-14 13 views
0

こんにちはみんなは、私たちはここに私たちのフロントページがあります。http://wp.partyloo.com/JSスクローラdoesntのスクロールをスムーズ

をそして私はちょうどその下の次のセクションにスクロールダウンすることにある矢印をスクロールダウンを追加しました。

私は、次のHTMLだ:

$('a[href*="#"]:not([href="#"])').click(function() { 
    if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) { 
    var target = $(this.hash); 
    target = target.length ? target : $('[name=' + this.hash.slice(1) + ']'); 
    if (target.length) { 
     $('html, body').animate({ 
     scrollTop: target.offset().top 
     }, 600); 
     return false; 
    } 
    } 
}); 

今あなたはそれがスムーズにスクロールダウンしていない矢印をクリックしたとき:

<a id="scroll" href="#second"><i class="fa fa-angle-down" style="font-size:54px; color: #fff; text-align: center; display: block; margin: 0 auto;" aria-hidden="true"></i></a> 

そして、ここでは、私が配置することをJSのですが。あなたがそれをクリックすると自動的に次のdiv /セクションに移動します。

スムーズにアニメーションをスムーズにスクロールできるようにするにはどうすればよいですか?

ありがとうございます!

答えて

0

私はあなたがこれを必要と思う?答えを

http://www.w3schools.com/css/css3_transitions.asp

a { 
    -webkit-transition: width 2s; /* Safari */ 
    transition: width 2s; 
} 
+0

おかげで、それは動作しません。 –

+0

それを修正する方法はありますか? –