PDA

View Full Version : Step Carousel - unable to navigate to every item in list



samad64
06-15-2011, 10:01 PM
1) Script Title: Step Carousel

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex4/stepcarousel.htm

3) Describe problem: Created a new step carousel on a webpage locally. 5 visible pieces, 12 pieces total. Script allows for me to navigate via keys to the first 8 pieces, but not the last four. The final screen (when highlighting #8) has items #9-12, but I am unable to select any of them. If I hit right again, with wraparound turned on, the script goes back to 1.

How can this script be modified to be able to navigate to every item in the list?

Thanks.

jscheuer1
06-16-2011, 06:38 AM
Please put up a demo of the problem somewhere on the web and give us a link to it.

samad64
06-16-2011, 03:30 PM
Please put up a demo of the problem somewhere on the web and give us a link to it.

I am unable to do this as this is for a project with an NDA.

jscheuer1
06-16-2011, 03:34 PM
Well, this is no limitation of the script. Well almost 100% not that. The only way to help is to have a demo of the problem.

Can't you just throw something together and put it up on the web? It doesn't have to use the same content even, just as long as it shows the problem.

samad64
06-16-2011, 03:50 PM
I cannot because the script is being implemented into a closed source javascript framework in order to demo functionality. Since it is not a part of a standard web page, it will just cause more confusion.

I can tell you however that I have utilized all three status variables (startp, endp, and totalp). TotalP always shows 12. When startp is 8, endp is 12. At this point, the script no longer scrolls to #9-12, but I can freely scroll through #1-8.

I implemented this script recently on another small project and noticed a 1 item difference. When I had 8 items in a list, it only allowed navigation to 7. The last piece cannot be navigated to.

Rather than debugging my problem without code, can you just point me in the direction I should be looking at in the script so that I can customize it myself? How is it calculating how many panels are in the belt?

jscheuer1
06-16-2011, 04:19 PM
It all looks too interrelated to me to pick out just one spot. You might want to look at this section:


var lastpanelindex=config.$panels.length-1
config.lastvisiblepanel=lastpanelindex

around line #87 to see if fudging that number helps:


var lastpanelindex=config.$panels.length+4
config.lastvisiblepanel=lastpanelindex

However, that's likely to cause an error. The way you're describing things sounds like some of the markup and/or the custom code could be at issue.

Have you looked at the page in a browser and then used the browser's 'view source'? That may show you that the markup is different than expected/required for this script. If so, you can tweak how the page is getting put together.

Firefox has a developer's extension that allows you to 'view generated source'. This can be useful in diagnosing javascript generated code and comparing it to what is needed. And/or for comparing it to what a typical installation of the script will generate.

If it were me, I'd try to get the script working on its own with my desired content first, without anything else involved. Then work at integrating it into a system. That way one can see if the problem is with the script, its implementation, or with its integration into other code.

samad64
06-16-2011, 04:47 PM
Thanks - removing the -1 allows me to navigate the entire list (plus 1 empty node, which is fine for now). With the -1 in place, I cannot navigate past 8. Very weird situation, but this will work. Appreciate the help!