Posted by anruether on December 26, 2011 at 4:55pm
3 followers
| Project: | jCarousel |
| Version: | 7.x-2.6 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs work |
Issue Summary
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!
Comments
#1
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.
#2
Added: 'needs review'
#3
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
#4
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 that195 // 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.
#5
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=5211 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 }
#6
#7
Actually, #5 does not solve the problem of not loading non-preloaded items.