How to set active navigation link
March 22, 2008 - 3:31am — katzwebdesign
| Project: | SerialScroll |
| Version: | 1.2.1 |
| Component: | User interface |
| Category: | support request |
| Priority: | normal |
| Assigned: | katzwebdesign |
| Status: | won't fix |
Jump to:
Description
I'm using code that's based on the SerialScroll demo page (more like cut-and-pasted), but one issue I can't figure out is how to set the current navigation link.
I'd like to set the active "tab" as in this MooTools example: http://www.playintraffik.com
Here's a link to my project: http://www29.a2hosting.com/~colchin/
I appreciate any help you can offer.

Comments
#1
Hi
I'm not sure I understand what you mean.
If you want to scroll to a certain element (f.e: the third) you use the event 'goto'.
Say you called the plugin like this:
$('#pane').serialScroll({.......});
So, whenever you want to scroll to the third, you do:
$('#pane').trigger('goto', [2]);
If what are aiming to do is, to mark the clicked link (this is it right?), you have 2 options.
Or you the onBefore event, where the 'this' of the function points to the activated element(link). So you do something like: $(this).addClass('selected');
Or, you just bind to the click of the elements, you don't need the plugin to do that.
I checked www.playintraffik.com and I think you can handle that better, using LocalScroll. http://flesler.blogspot.com/2007/10/jquerylocalscroll-10.html.
It's very similar to SerialScroll, but more adequate to situations of this kind.
Please let me know if you solve this or you need more help, and close the tickets on the first case.
Cheers
If you don't want it to scroll, but just to
#2