jScroll icon indicating copy to clipboard operation
jScroll copied to clipboard

scoll onload

Open karlmikko opened this issue 13 years ago • 0 comments

    return this.each(function() {
        var $element = $(this);
        var $window = $(window);
        var locator = new location($element);

        $window.scroll(function() {
            $element
                .stop()
                .animate(locator.getMargin($window), opts.speed);
        }).scroll();
    });

by adding the .scroll(); after the callback is defined will enable the callback to be executed instantly. This will allow the plugin to work when someone has used the back button in a browser and it loads already scrolled down a page.

Currently this will only bring the element into view when the user scrolls. The extra .scroll() will enable it to come in on load.

karlmikko avatar Oct 18 '11 00:10 karlmikko