djett41 / ionic-scroll-sista

An Ionic plugin that hides the header/tabs while scrolling
MIT License
125 stars 38 forks source link

I have error #29

Open javarv87 opened 8 years ago

javarv87 commented 8 years ago

Uncaught TypeError: Cannot read property 'scrollTop' of undefined 278 I use ion-side-menus with only header

correasebastian commented 8 years ago

same error here, using ionic serve, everything works fine, but is not working running on the phone (samsung galaxy prime ); i got this :Cannot read property 'scrollTop' of undefined

using the debugger the e object has this properties only:

bubbles: false cancelBubble: false cancelable: false clipboardData: undefined currentTarget: ion-content.scroll-content.ionic-scroll.overflow-scroll.has-header.has-tabs defaultPrevented: false eventPhase: 2 isDefaultPrevented: function () { isImmediatePropagationStopped: function () { returnValue: true srcElement: ion-content.scroll-content.ionic-scroll.overflow-scroll.has-header.has-tabs stopImmediatePropagation: function () { target: ion-content.scroll-content.ionic-scroll.overflow-scroll.has-header.has-tabs timeStamp: 1456705478877 type: "scroll"

github repo : https://github.com/correasebastian/shrink/

correasebastian commented 8 years ago

i got an answer, if you are using ionic > 1.2.0 nativescroll is the default scroll, so. in order to make "scroll sista" works you have to enable jsScrolling . this way

yourmodule.config(function($ionicConfigProvider) { //jsScroll enabling $ionicConfigProvider.scrolling.jsScrolling(true)})

correasebastian commented 8 years ago

this is a working example

https://github.com/correasebastian/shrink/

tsuiwwwayne commented 8 years ago

Hi,

I have tried using scroll-vista on my own app, but it does not work. @correasebastian I loaded ur repo and tried it, it works.

I planted console.log messages inside the ionic.scroll.sista.js translateY function in both the shrink repo and my own app.

In my own app, the scroll event only executed once, when the page loads. Whereas in the shrink repo, the scroll event is executed whenever I scroll.

Does anyone know what's the issue here?