sticky-kit icon indicating copy to clipboard operation
sticky-kit copied to clipboard

sticky div jumpy when scrolling down, fine when scrolling up

Open bibliofille opened this issue 8 years ago • 1 comments

I used sticky kit to have a div (project-info) remain in place once it reaches the top of the page. Then the images in the right column continue scrolling. This feature only works on desktop.

It works great when scrolling back up the page, however, it is a bit jumpy when scrolling down initially, and the entire .project-info div doesn't stay in view when scrolling down.

I'm not sure I did anything differently, since it was working before. The client entered a bunch of content, but I don't think that should be throwing it off.

Here's my URL: http://propellerfund.flywheelsites.com/projects/filmfront/ (Flywheel requires a password for dev sites, so the username is:flywheel; password: propellerfund)

Here's my sticky kit code: `jQuery(document).ready(function(){

var window_width = jQuery( window ).width();

if (window_width < 768) {
  jQuery(".project-info").trigger("sticky_kit:detach");
} else {
  make_sticky();
}

jQuery( window ).resize(function() {

  window_width = jQuery( window ).width();

  if (window_width < 768) {
    jQuery(".project-info").trigger("sticky_kit:detach");
  } else {
    make_sticky();
  }

});

function make_sticky() {
  jQuery(".project-info").stick_in_parent({
  });
}

});`

bibliofille avatar Nov 22 '16 03:11 bibliofille

+1 I'm facing the same issue please help!

jan1980 avatar Aug 01 '17 15:08 jan1980