garand / sticky

jQuery Plugin for Sticky Objects
Other
3.3k stars 1.06k forks source link

Wrapper does'nt appears without scrolling on load #118

Open reuhno opened 10 years ago

reuhno commented 10 years ago

Hi, with a big html page that have a preloader in Jquery, when I reload a page (so, i'm not viewing page from the top), script needs a scroll action to appears.

Indeed, the class is-sticky isn't added to the DOM.

So, I think, scroller() function must be called after you init method. It seems it's not actually true.

I must add scroller() after sticked.push() to work, but I'm note sure it's the better way. Eg : sticked.push({ topSpacing: o.topSpacing, bottomSpacing: o.bottomSpacing, stickyElement: stickyElement, currentTop: null, stickyWrapper: stickyWrapper, className: o.className, getWidthFrom: o.getWidthFrom }); scroller();

Gostonet commented 9 years ago

hi

i had the same issue i resolve this this issue by moving the init methode from $(document).ready( function() {}) to $(window).load(function() {})

it work fine now

knownasilya commented 9 years ago

Also have this issue, where currentTop is null and nothing happens.