Created
March 28, 2012 18:00
-
-
Save benhuson/2228781 to your computer and use it in GitHub Desktop.
TouchCarousel - Detach
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Detach carousel - same as destroy but content is not removed */ | |
detach: function() { | |
this.stopAutoplay(); | |
this._itemsWrapper.unbind(this._downEvent); | |
$(document).unbind(this._moveEvent).unbind(this._upEvent); | |
$(window).unbind(this._resizeEvent); | |
if(this.settings.keyboardNav) { | |
$(document).unbind("keydown.touchcarousel"); | |
} | |
if (this._dragContainer.parent().hasClass('touchcarousel-wrapper')) { | |
this.setXPos(0); | |
this._dragContainer.unwrap(); | |
} | |
}, |
I de-minified mine and I see where the problem lies. After minifying the functions _[something] have all be renamed to shorter ones, therefore e.g. _Itemswrapper does not exist, therefore you cannot unbind it.
I got it working, thanks for everything :) In addition I added the option to remove the pagingNav when present.
Cool, glad it works for you.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I added it after the 'prev' function was declared. Thus, right after: "{c=(this._jq2-1)_this._hs2}else{c=0}}else{c=d_this._hs2}}this.goTo(c,a)}," (just ctrl+f to find that)