jsor/jcarousel — Issue #284: Webkit hashchange error
Author: daveschwerstein
Created: 2011-12-15 20:42:25+00:00
State: open

Hello all,

I am using a hashchange bind to trigger the carousel to either scroll backwards or forwards depending on which direction the user travels in the history. Everything seems to work fine in Firefox, IE and Opera. However, in webkit browsers, when the user travels forwards is the history to the second-to-last slide, the slide that the carousel scrolls to is the last slide instead of the second-to-last slide. Has anyone had this issue before and know why this is happening?

li example:

code example:

jQuery('#mycarousel').jcarousel({
scroll: 1
});

var carousel = jQuery('#mycarousel').data('jcarousel');

$(window).bind('hashchange', function() {
var hash = location.hash.split('#');
var slide_id = hash[1].split('_');
carousel.scroll(jQuery.jcarousel.intval(slide_id[1]));
});