views:

105

answers:

1

Hi all, i am using jCarousel as a menu in my website. there is a list of links there which is longer than its containing elements and jCarousel is used as a scroll bar to view that list. my problem is that whenever a link is clicked and a new page is loaded, jCarousel resets to its begining position thus sometimes an active link is no longer visible after the page reloads. any idea how i can make jCarousel focus on the specific active link?

you can see an example of what i mean here: http://174.133.190.8/~goldarch/index.php?option=com_content&view=article&id=50&Itemid=57 (check out the menu on top)

thank you all.

A: 

I have managed, finally, to pull it off by using this bit of code when i call the lCarousel object: this is what i had in my section:

<script type="text/javascript">
jQuery(document).ready(function() {
    var container = jQuery('#mycarousel');
    var startPlace = jQuery('li',container).index(jQuery('#current',container));
    startPlace = startPlace + 1;
    jQuery('#mycarousel').jcarousel({
        start: startPlace/*,
        wrap: 'last' */
    });
});
</script>

hope this will help someone in the future.

Crippletoe