vendredi 14 novembre 2014

Catching scroller position works, but how to get parent components from scroller?

Thanks to another post here I managed to add an event listener to the scroller of a container. Now I want to hide another container when the scroller reaches a certain position.

Getting the position is working but as methods like .getParent() don't work on the scroller iself I can't figure out how to call other components (without using unique IDs).



Code:



var scroller = this.down('[itemId=channelCarousel]').getScrollable().getScroller();
scroller.on({
scroll : function() {
if (scroller.position.x > 500) {
//do something
}
else {
//do something else
}
}
});

How to find the container that is holding the scroller?



Catching scroller position works, but how to get parent components from scroller?

Aucun commentaire:

Enregistrer un commentaire