[Plugin: WP Carousel] carousel not scrolling on load (setCookie() bug)
-
Background:
When one clicks a panel in the carousel, the current panel is saved in a
cookie from the Carousel JavaScript ‘unload’ handler. When the page
reloads (because a panel was clicked), this cookie is loaded again and
should make the Carousel scroll so that the clicked panel becomes visible
again.The bug:
Sometimes, it may occur that the path to the page from which the setCookie() function is called differs from the page that should load the cookie. This is a problem because the latest (as of writing) version of WP Carousel does not manually set a path.The fix:
In `stepcarousel.js’, modify the setCookie() function:setCookie:function(name, value){ document.cookie = name+"="+value },Change this function to:
setCookie:function(name, value){ document.cookie = name+"="+value+"; path=/;" },This sets the ‘cookie path’ to the root of the server (‘/’). Now every
page (originating from the domain that set the cookie of course) may access the cookie, and therefore it solves the problem.
The topic ‘[Plugin: WP Carousel] carousel not scrolling on load (setCookie() bug)’ is closed to new replies.