Modifying the amount of horizontal travel in a dynamic ajax carousel.

Please take a look at this question which has already been answered : http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_24136005.html#a23619574

Can you tell me what part of what code determines the number of images that are moved over with every click? The default is to three. What line of code (in what file) would I modify to make that 2 images per click or one image? I thought I might find it in the ajax text file, but I couldn't. And the jquery files are a little overwhelmong for me at this point.

Thanks!
John
LVL 1
John CarneyReliability Business Tools Analyst IIAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ali_pakkanCommented:
For the example on "http://sorgalla.com/projects/jcarousel/examples/dynamic_ajax.html"..

You can change the behaviour playing with "width" attributes in the following styles:

jcarousel-container-horizontal
jcarousel-clip-horizontal

on

http://sorgalla.com/projects/jcarousel/skins/ie7/skin.css
0
John CarneyReliability Business Tools Analyst IIAuthor Commented:
Unfortunately doing that just changes the width of the container or the clip. I want the container and clip to have the same width, i just want to know how to move the clip by one or two pictures instead ofthree.
In other words as it is now, when the page loads you see three images, 1, 2, and 3. When you click on the right arrow, all three shift to the left and now we see images 4, 5, and 6.
I want to know what line of code to change so that when we click the arrow, we see images 3, 4, and 5  or  images 2, 3 , and 4.
Thanks,
John
0
sosamvCommented:
Hi there! i think i'be found that variable you're looking for, please provide a zip file with all of the files from your project (all javascripts and example html). The main Javascript (../lib/jquery.jcarousel.pack.js) is compressed using a javascript compressor found on this link: http://dean.edwards.name/packer/ 

thats the reason why its difficult to modify the script, if you post the files i can decrypt it using that same page and help you with the changes.

Ciaoo!
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

sosamvCommented:
ups i've found it on http://sorgalla.com/projects/jcarousel/   LOL hehe, let me take a look ;)
0
ali_pakkanCommented:
sosamv's right.. on that site is the parameter you're looking for..

scroll (default:3):         The number of items to scroll by.

0
sosamvCommented:
Tried with that one, but thats the number of items it scrolls per click, but the same 3 items are showing :S
0
John CarneyReliability Business Tools Analyst IIAuthor Commented:
I don't have a zip utility that works right now, but you can download all the active files from the html: http://www.discretedata.com/JCRD/Carousels/dynamicAjaxJC1.html. Please take a look and let me know if you can see where to make the change from 3 slides to 2 or 1.
Thanks. -John
I couldn't figure out which file had the scroll (default:3) in it, although it sounds like that doesn't work anyway.
0
ali_pakkanCommented:
scroll at that point:

jQuery(document).ready(function() {
    jQuery('#mycarousel').jcarousel({
        itemLoadCallback: mycarousel_itemLoadCallback,
        scroll: 1
    });
});

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
John CarneyReliability Business Tools Analyst IIAuthor Commented:
What file is that in? I couldn't find it in my html.
 
0
John CarneyReliability Business Tools Analyst IIAuthor Commented:
Okay I can see where that fits in now, but what was making it default to 3 in the first place?
In other words which file contains the line <  scroll (default:3):  >? I can see from sosamv's link that you can set the scroll number in the Configuration file, but where is that file vis a vis my version of the carousel?
Thanks,
John
0
ali_pakkanCommented:
You mean the default value.. It must be in jquery.jcarousel.pack.js.. Yet, since it is packed, it'll not be easy to find it :)..

I downloaded the unpacked normal version and in that file, you can see it..



    // Default configuration properties.
    var defaults = {
        vertical: false,
        start: 1,
        offset: 1,
        size: null,
        scroll: 3,
        ...
        ...

Open in new window

0
John CarneyReliability Business Tools Analyst IIAuthor Commented:
Thanks! Out of curiosity, what's the exact link of the unpacked version that you downloaded? I found a great unpacking utiility online, but the var defaults still came out in one long string. Yours has the standard js formatting, so I'm just curious ...
In any event the unpacking utility is here: http://matthewfl.com/unPacker.html
Before your last post I had no idea what packing was, so thanks!
-John
 
 
 
0
sosamvCommented:
the unpacked version in within the same zip file you downloaded hehe i tried making the change by myself and changing the variable scroll: 3 to scroll: 1, will only change the number of images scrolled per click :S i thought that wasnt what you wanted hehe anyway, hope you got it working, byeee
0
ali_pakkanCommented:
It's good to hear that everything is OK.

http://sorgalla.com/projects/jcarousel/
Download jcarousel.zip
jcarousel/lib/jquery.jcarousel.js

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.