avianey / jqDoubleScroll

A jQuery plugin that duplicate the bottom scrollbar of an element to its top
74 stars 65 forks source link

Destroy / remove event #8

Open tkodev opened 7 years ago

tkodev commented 7 years ago

How does one remove doubleScroll from an element? I'm using a virtual dom library (such as react) that constantly removes, then adds new elements. I need to know how to tear down doubleScroll to avoid creating two instances of doubleScroll on one element in case the element is only updated and not recreated.

tkodev commented 7 years ago

Ex: $(element).removeScroll();

JeroenvO commented 6 years ago

I just re-initialize the scrollbar after content update, and i do not see multiple scrollbars. so i don't think a remove function is needed.

JeroenvO commented 6 years ago

Or manually trigger the resize event, if you have resetOnWindowResize set to true using: $('.double-scroll').trigger('resize.doubleScroll');