Skip to content

Instantly share code, notes, and snippets.

@ovenbits
Created December 8, 2010 17:22
Show Gist options
  • Save ovenbits/733584 to your computer and use it in GitHub Desktop.
Save ovenbits/733584 to your computer and use it in GitHub Desktop.
ad gallery mod
.css('opacity', 0.6)
.mousedown(
function() {
var direction = 'left';
if($(this).is('.ad-forward')) {
direction = 'right';
};
thumbs_scroll_interval = setInterval(
function() {
has_scrolled++;
// Don't want to stop the slideshow just because we scrolled a pixel or two
if(has_scrolled > 30 && context.settings.slideshow.stop_on_scroll) {
context.slideshow.stop();
};
var left = context.thumbs_wrapper.scrollLeft() + 1;
if(direction == 'left') {
left = context.thumbs_wrapper.scrollLeft() - 1;
};
context.thumbs_wrapper.scrollLeft(left);
},
10
);
$(this).css('opacity', 1);
})
.mouseup(
function() {
has_scrolled = 0;
clearInterval(thumbs_scroll_interval);
$(this).css('opacity', 0.6);
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment