Skip to content

Instantly share code, notes, and snippets.

@metamn
Created May 7, 2011 10:01
Show Gist options
  • Save metamn/960378 to your computer and use it in GitHub Desktop.
Save metamn/960378 to your computer and use it in GitHub Desktop.
Multiple Scroller
// Scrolling products at frontpage for all sections
jQuery.localScroll.defaults.axis = 'xy';
jQuery(".section").each(function(){
jQuery.localScroll({
target: "#" + jQuery(this).attr('id') + " #articles",
duration: 1000,
hash: false,
onBefore:function( e, anchor, $target ){
var sectionID = $target.selector.split(" ")[0];
//var sectionID = "#" + $target[0].id.toString();
var targetID = "#" + anchor.id.toString();
if ( jQuery(sectionID).find(targetID).length == 0 ) {
return false;
}
},
onAfter:function( anchor, settings ){
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment