I am considering using the jCarousel module for viewing nodes. The active item would display node content and the inactive nodes would be just an image and node title. I am confident of doing this with css.

However it is likely that I will be able to set up links from other pages directly to items in the carousel. When clicked I want the page to load with the relevant node as the active one.

Is this possible?

Comments

quicksketch’s picture

Status: Active » Fixed

This is possible with the jCarousel API, but it's not a built-in feature of the library or the jCarousel module (and probably shouldn't be). You would need to add custom JavaScript to your theme or a custom module that looked sort of like this:

var itemNumber = window.location.hash.match(/^#item-(\d+)/);
if (itemNumber) {
  var carousel = jQuery('#mycarousel').data('jcarousel');
  carousel.scroll(itemNumber);
}

This would take an a URL such as http://example.com/page#item-10 and then scroll to the tenth item when the page loads. I'm not sure how you would make the carousel start immediately on a particular item without scrolling, but I suggest reading through the jCarousel docs to investigate such solutions. I generally don't help with custom coding questions in the issue queue. I'm marking this issue fixed directly because I'm unlikely to provide more information, and there hasn't been any other activity in this thread.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.