somewebmedia / hc-sticky

JavaScript library that makes any element on your page visible while you scroll.
https://somewebmedia.github.io/hc-sticky/
MIT License
462 stars 114 forks source link

Have problem with different top: in responsive design. #18

Closed ve3 closed 7 years ago

ve3 commented 9 years ago

Hello.

The desktop design top: is 50, tablet or mobile version is 100.

I cannot off/destroy or anything.

sticky_menu_top = $('.navbar').height();
$('.page-sidebar').hcSticky({
    bottom: 0,
    bottomEnd: 8,
    top: sticky_menu_top,
});
$(window).on('resize', function() {
    sticky_menu_top = $('.navbar').height();
    //$('.page-sidebar').hcSticky('stop');
    $('.page-sidebar').hcSticky('destroy'); 
});

This is error in browser console.

TypeError: e(...).data(...) is undefined

I cannot off or destroy it. So, I cannot make sure that how do i change top offset in each window size.

somewebmedia commented 7 years ago

Obsolete. New major version available.