sticky footer - Jquery - Stick element on bottom of the page until scrolled to it - page with accordion -
i have element, sticked bottom of page using waypoints.js
, following code:
$('.sticky-container').waypoint(function (direction) { if (direction == 'down') { $(this).addclass('active'); } else { $(this).removeclass('active'); } },{offset:'100%'});
this works fine, have accordions on page - when open accordion item, page height changes, change isn't reflected in waypoint script , sticky element disappears soon.
i created jsfiddle explain better mean: http://jsfiddle.net/scr5l/3/
how can fixed?
for needing this, got response waypoints.js support:
bootstrap's hide.bs.collapse , show.bs.collapse fire @ beginning of collapse transitions. want use events fire when transition complete, hidden.bs.collapse , shown.bs.collapse:
$('.collapse').on('shown.bs.collapse hidden.bs.collapse', function (e) { e.stoppropagation(); $.waypoints('refresh'); })
works charm me.
Comments
Post a Comment