Zen Cart Logo
Forums / General Questions / jQuery slider to scroll a Div

jQuery slider to scroll a Div

Locked

Views: 6,894

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
4 Jan 2009, 12:30 AM
#1
cxdmedia avatar

cxdmedia

New Zenner

Join Date:
Nov 2008
Posts:
10
Plugin Contributions:
0

jQuery slider to scroll a Div

Hi, I'm trying to use this .js to scroll my product listings. The problem with the script, it sets a fixed width on the hidden/overflow div container. This is a problem as each category may have any number of products.

You can see how it is implemented on my store here:

http://tattoodesignmall.com/index.php?main_page=index&cPath=2

I'm using "column" layout and tried to modify the:

product_listing.php

I tried updating the else statement to use the ($num_products_count) instead of PRODUCT_LISTING_COLUMNS_PER_ROW (which is being pulled from the Admin - Config - Prod listing

} else {
  $col_width = floor(100/$num_products_count) - 0.5;

but this did not seem to work.

Has anyone gotten a slider to work with ZenCart?

Here's the javascript slider if there are any php/ZenCart experts willing to take a look. I think its a cool feature that a lot of sites could use:

http://blog.paranoidferret.com/index.php/2008/10/24/using-jquery-slider-to-scroll-a-div/

Thanks!!

-Chris

4 Jan 2009, 12:51 AM
#2
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: jQuery slider to scroll a Div

Oh, a slider, I remember we did it on a site, let me check

4 Jan 2009, 12:55 AM
#3
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: jQuery slider to scroll a Div

If you want, you can use the number of products AND the image size to calculate the width you need.

4 Jan 2009, 1:00 AM
#4
cxdmedia avatar

cxdmedia

New Zenner

Join Date:
Nov 2008
Posts:
10
Plugin Contributions:
0

Re: jQuery slider to scroll a Div

Very cool. Any idea how to do this?

29 Jan 2010, 7:21 PM
#5
abdulmueid avatar

abdulmueid

New Zenner

Join Date:
Jan 2010
Posts:
4
Plugin Contributions:
0

Re: jQuery slider to scroll a Div

$col_width = $num_products_count * <your_image_width>

that should give you the correct width.

On the other hand, why don't you just override the tpl_columnar_display.php and edit that. Remember that the actual columnar table is created inside this file so it will be easier to manipulate the listing in there.

29 Jan 2010, 8:14 PM
#6
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: jQuery slider to scroll a Div

Caution: tpl_columnar_display may be used in more than one place, so make sure you want the effect everywhere it is used before changing its behavior.

29 Jan 2010, 8:30 PM
#7
abdulmueid avatar

abdulmueid

New Zenner

Join Date:
Jan 2010
Posts:
4
Plugin Contributions:
0

Re: jQuery slider to scroll a Div

True gjh42, thanks for the heads-up.