Jump to content

Products Category v1.3 Auto Scroll - how?


johnk12

Recommended Posts

I'm using the included Prestashop module 'Products Category v1.3' to show other products in the same category on the product page. I would like it to auto scroll right after a few seconds - anyone know how this can be achieved?

 

Just to be clear - When you click on the right arrow the images slide, I want this to happen automatically.

 

prestashop 1.4.3

Link to comment
Share on other sites

Ignore that nonsense. Edit modules/productscategory/prodoctscategory.js so it looks like this.

 

function pc_serialScrollFixLock(event, targeted, scrolled, items, position)
{
var leftArrow = position == 0 ? true : false;
var rightArrow = position + 5 >= $('#productscategory_list li:visible').length ? true : false;

$('a#productscategory_scroll_left').css('cursor', leftArrow ? 'default' : 'pointer').fadeTo(0, leftArrow ? 0 : 1);		
$('a#productscategory_scroll_right').css('cursor', rightArrow ? 'default' : 'pointer').fadeTo(0, rightArrow ? 0 : 1).css('display', rightArrow ? 'none' : 'block');

return true;
}

$(document).ready(function()
{
$('#productscategory_list').serialScroll({
	items: 'li',
	prev: 'a#productscategory_scroll_left',
	next: 'a#productscategory_scroll_right',
	axis: 'x',
	offset: 0,
	stop: true,
	onBefore: pc_serialScrollFixLock,
	duration: 300,
	step: 1,
	lazy: true,
	lock: false,
	force: true,
	cycle: true,
	interval: 3000//auto scroll constantly
 });

$('#productscategory_list').trigger( 'goto', 0);

});

 

More:

http://flesler.blogspot.com/search/label/jQuery.SerialScroll

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 year later...
  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...