Dear Developer,

I have follwed the documentations to install the jCarousel. I need help on
"1) Add the required JS/CSS files by calling this function:
jcarousel_add();"

Can you provide a simple example for me to follow? I went to the http://sorgalla.com/jcarousel/ website and looked at the examples but there is no mention of jcarousel_add();.

Please help. Thanks!

Comments

wim leers’s picture

All this module does, is adding the required .js file. That's what the jcarousel_add() function is for.

After you've done that, you must still write the required jQuery/JavaScript to make use of the functions the jCarousel plugin gives you. See the Message Effects module for example. This module makes use of the jQuery Interface module, which does something similar as the jCarousel module, but then for the Interface plugin for jQuery.

alippai’s picture

You can create a module/page/block with it :)
For example I made a pager for my Acidfreegallery from it ;) http://gimi.brain.sk/node/821

wim leers’s picture

Status: Active » Closed (fixed)
ThanhBT’s picture

Status: Closed (fixed) » Postponed (maintainer needs more info)

Sorry, i'm noob in development.
Plz show me guide simple to use this. Thank a lot.

jcfiala’s picture

Check out the original site for jCarousel at http://sorgalla.com/projects/jcarousel/ - there's several examples and a fair amount of documentation there.

Basically what you do is:
1) set up a list

    of items you want in the carousel.
    2) call the javascript to turn that
      into a carousel for display.
wim leers’s picture

Status: Postponed (maintainer needs more info) » Fixed
hansrossel’s picture

Maybe to be sure everybody gets it, here a code example:
Make a block and put this as content:


<?php 
jcarousel_add();
?>

<script type="text/javascript">
jQuery(document).ready(function() {
    jQuery('#mycarousel').jcarousel();
});
</script>

<ul id="mycarousel" class="jcarousel-skin-tango">
  <li><img src="http://static.flickr.com/66/199481236_dc98b5abb3_s.jpg" width="75" height="75" alt="" /></li>
  <li><img src="http://static.flickr.com/75/199481072_b4a0d09597_s.jpg" width="75" height="75" alt="" /></li>
  <li><img src="http://static.flickr.com/57/199481087_33ae73a8de_s.jpg" width="75" height="75" alt="" /></li>
  <li><img src="http://static.flickr.com/77/199481108_4359e6b971_s.jpg" width="75" height="75" alt="" /></li>
  <li><img src="http://static.flickr.com/66/199481236_dc98b5abb3_s.jpg" width="75" height="75" alt="" /></li>
  <li><img src="http://static.flickr.com/75/199481072_b4a0d09597_s.jpg" width="75" height="75" alt="" /></li>
  <li><img src="http://static.flickr.com/57/199481087_33ae73a8de_s.jpg" width="75" height="75" alt="" /></li>
  <li><img src="http://static.flickr.com/77/199481108_4359e6b971_s.jpg" width="75" height="75" alt="" /></li>
  <li><img src="http://static.flickr.com/66/199481236_dc98b5abb3_s.jpg" width="75" height="75" alt="" /></li>
  <li><img src="http://static.flickr.com/75/199481072_b4a0d09597_s.jpg" width="75" height="75" alt="" /></li>
  <li><img src="http://static.flickr.com/57/199481087_33ae73a8de_s.jpg" width="75" height="75" alt="" /></li>
  <li><img src="http://static.flickr.com/77/199481108_4359e6b971_s.jpg" width="75" height="75" alt="" /></li>
  <li><img src="http://static.flickr.com/66/199481236_dc98b5abb3_s.jpg" width="75" height="75" alt="" /></li>
  <li><img src="http://static.flickr.com/75/199481072_b4a0d09597_s.jpg" width="75" height="75" alt="" /></li>
  <li><img src="http://static.flickr.com/57/199481087_33ae73a8de_s.jpg" width="75" height="75" alt="" /></li>
  <li><img src="http://static.flickr.com/77/199481108_4359e6b971_s.jpg" width="75" height="75" alt="" /></li>
</ul>

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

mbria’s picture

Thanks a lot.

When you are insure about how much work is taken by the integration, it really helps.

jdl100’s picture

Hi Hans,

Thanks for your example. I'm using Drupal 5.

I created a block. I added all of the code to the block that you listed and I set the block input type to php. However, the carousel doesn't display. Firebug displays these errors: $("#mycarousel").jcarousel is not a function.

Someone else mentioned that jcarousel_add(); needed to be added to the template.php file instead. I tried that but I still ran into errors with it not understanding jcarousel.

Do you mind explaining exactly where this code belongs?

jQuery(document).ready(function() { jQuery('#mycarousel').jcarousel(); });

Thanks,

jdl

fehin’s picture

subscribing

eggthing’s picture

subscribe