Hallo, I would like to link to a specific image in the carousel. Something like http://example.com/carousel.html#slide5 Would that be possible? It would be very useful for finding content better. Thanks!

CommentFileSizeAuthor
#1 jcarousel-startposition-1386288-1.patch1.01 KBhpbruna
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hpbruna’s picture

Hi,

I create a patch on this request. It takes the position from the URL from the 'pos' parameter e.g. example.com?pos=5 and then the jcarousel startposition is set to 5.

hpbruna’s picture

Status: Active » Needs review

Added: 'needs review'

anruether’s picture

Great, this is a good solution when you want to link to a specific slide. If you are already on the site you might think that the additional pageload is unnecessary.

Another thing would be to have the slide address appear in the url when clicking through the carousel. This would need implementation with next/prev buttons I guess.

But this is already great help for me! You can try it on my website if you want( http://www.aruether.net/photo/landscape?pos=4 )

Thanks a lot!
Andi

Mac_Weber’s picture

It does not work well for items not preloaded, as described on the comments:

194     // If starting in the middle of a view, initialize the carousel at that
195     // position. Strangely the carousel must pre-load empty LI items all the way
196     // up until the active item, making this inefficient for large lists.
Mac_Weber’s picture

How to get it to work prelaoding form that position:

[...]

210    // takes the position from the URL from the 'pos' parameter e.g. example.com?pos=5
211   if(isset($_GET['pos'])){
212     $urlstartposition=$_GET['pos'];
213     $options['start'] = (float)$urlstartposition;
214     $options['offset'] = (float)$urlstartposition;
215   }
216   $identifier = drupal_clean_css_identifier('jcarousel_dom_' . $options['view_options']['jcarousel_dom_id']);
217   return jcarousel_add($identifier, $options);
218 }
Mac_Weber’s picture

Status: Needs review » Needs work
Mac_Weber’s picture

Actually, #5 does not solve the problem of not loading non-preloaded items.