2017-06-02 6 views
0

現在、ホームページにはさまざまな行があり、各行にはボタンがあります。ボタンをクリックすると、divがページの上部にスライドします。しかし一方で、ボタンに追加された別のアクションもあります。以下は私のjsのコードです:私は使用しています現在のdivにスライドをスクロール

$(".expandable-container-mobile").click(function() { 

      var el = $(this).find('.mobile-show-section');//get the current element 
      var el2 = $(this).find('.expandable'); 

      el.stop().slideToggle(700);//toggle the current one 
      $(this).children('.expandable').toggleClass('clicked'); 


      $('.expandable').not(el2).removeClass('clicked'); 
      $('.mobile-show-section').not(el).stop().slideUp();//hide the rest 

     }); 

scrollify JS $ .scrollify.move( "#名");それはdiv-section-nameで動作しないように見えますが、それを達成する他の方法もうまくいきます。

+0

は同様に私たちは何の良いアイデアを持っているので、あなたのHTMLを投稿を参照してください。あなたがやろうとしている –

答えて

0

使用jQueryの、

コード -
function scrollToAnchor(aid){ 
    //get the element to be scrolled 
    var el = $(this).find('.mobile-show-section'); 
    //then scroll it using jQuery annimation 
    $('html,body').animate({scrollTop: el.offset().top},500); 
    }; 

の作品私の答えの一部、

Answer1

Answer2

関連する問題