bosspetta bosspetta - 4 months ago 19x
jQuery Question

Add class when scroll down with AlloyUI

I need to add a class when the user scroll down. I usually do this with jQuery:

$(window).scroll(function() {
var scroll = $(window).scrollTop();
if (scroll >= 10) {

How can I do the same thing with AlloyUI?
Really thanks.


Using the ScrollInfo plugin and its scroll event

var body ='body');


body.scrollInfo.on('scroll', function (e) {
    if (e.scrollTop >= 10){'.dockbar').addClass('dockbar-opacity');