peachananr / onepage-scroll

Create an Apple-like one page scroller website (iPhone 5S website) with One Page Scroll plugin
http://peachananr.github.io/onepage-scroll/Demo/demo.html
9.54k stars 2.06k forks source link

var y = $(window).scrollTop(); $(window).scrollTop(y+150); broken. "body" doesnt work neither #293

Open torian257x opened 8 years ago

torian257x commented 8 years ago

it seems that the onepage scroll plugin breaks the scrolling IN RESPONSIVE FALLBACK MODE of jQuery i am NOT talking about fullpage scrolling when it is active. I am talking about the fallBack option, when the plugin supposedly is not active

var y = $(window).scrollTop(); $(window).scrollTop(y+150); doesn't work var y = $("html,body").scrollTop(); $("html, body").scrollTop(y+150);

doesn't work $('html, body').animate({ scrollTop: $("#elementtoScrollToID").offset().top }, 2000);

doesnt' work

Zackio commented 8 years ago

Did you find any solution this?

vadymsmiyun commented 8 years ago

Is there any solution?

torian257x commented 8 years ago

I don't really remember what I finally did, I think: i just reloaded the whole page and eventually used the native scroll that is:

goToPageNoMenu: function(pageNr, selectorFallback){
    if(darp.device.isFullScreenScroll()){
      $('.main').moveTo(pageNr);
    }else{
      $(selectorFallback)[0].scrollIntoView( true );
      var y = $(window).scrollTop(); $(window).scrollTop(y+150);  //your current y position on the page

    }
  }

The page i worked on was this:

https://www.darienpilates.com/

you can find the full sourcecode in darp.js