Skip to content

Instantly share code, notes, and snippets.

@dtex
Created November 19, 2012 16:19
Show Gist options
  • Save dtex/4111574 to your computer and use it in GitHub Desktop.
Save dtex/4111574 to your computer and use it in GitHub Desktop.
slipNSlide effect for jQuery Tools tabs
/*
This custom tabs effect will close one accordion and then open the other
as opposed to trying to do both at the same time like "slide"
*/
$.tools.tabs.addEffect("slipNSlide", function(i, done) {
var conf = this.getConf();
if(this.getCurrentTab().length !== 0) {
this.getPanes().slideUp(conf.slideUpSpeed);
window.setTimeout( function(that, conf){
that.getPanes().eq(i).slideDown(conf.slideDownSpeed, done);
}, conf.slideUpSpeed, this, conf);
} else {
this.getPanes().eq(i).slideDown(conf.slideDownSpeed, done);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment