davetayls / jquery.kinetic

Add kinetic scrolling functionality to a container using mouse or touch devices
http://davetayls.me/jquery.kinetic
MIT License
420 stars 86 forks source link

Slow drag performance with images in the div #70

Closed Globegitter closed 7 years ago

Globegitter commented 10 years ago

Using this plugin has been working very well but now that I have added some more images in the div that should be draggable the performance has become quite noticable worse. I have tried to play around with a couple of settings to increase the performance and scrolling works fine again, but dragging is still a bit laggy. This is what I have right now:

Ember.$('.date-component').kinetic({
      slowdown: 0.9,
      y: false,
      throttleFPS: 40,
      triggerHardware: true
});

Are there any other tricks to increase the performance, or is this simply an issue because if I have to much 'stuff' in the date-component div?

davetayls commented 10 years ago

unfortunately, it does suffer when the complexity of the contents rises ... especially with images. I would actually try removing the triggerHardware option as it could speed it up.

How many images have you got inside it?

Globegitter commented 10 years ago

There are 3 png's in there, all below the size of 500x500. I actually had to change some behaviour and the images are now outside the div and absolutely positioned over it. So performance is back to normal. Thanks for the tip though, really appreciated.