jcubic / jquery.splitter

Plugin that split your content with draggable divider

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

detroy error

cbtgit opened this issue · comments

From the destroy method:
Shouldn't the first line in the code below be wrapped in $( )? I get an "each is not a function" error otherwise?
$splitters.each(function() { var splitter = $(this); splitter.off("mouseenter"); splitter.off("mouseleave"); splitter.off("touchstart"); splitter.off("touchmove"); splitter.off("touchend"); splitter.off("touchleave"); splitter.off("touchcancel"); splitter.remove(); });

should be
$($splitters).each(function() { var splitter = $(this); splitter.off("mouseenter"); splitter.off("mouseleave"); splitter.off("touchstart"); splitter.off("touchmove"); splitter.off("touchend"); splitter.off("touchleave"); splitter.off("touchcancel"); splitter.remove(); });

Yest that's right will use forEach since it's array of jQuery objects not jQuery object with elements inside.

Thanks for the report. I will need to refactor destroy it also don't remove inline styles.

The code seems to have $splitters.forEach.