Copied and pasted the code given in the example on a block gave only a list of images without any arrows or theming applied. Is it supposed to work only with views?

<?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>

Comments

Michiel M-effect’s picture

I don't believe you have the correct code there. Where did you find it?
This is the code i use on blocks. It works fine

$items = array (
  0 => '<img src="image1.jpg" width="590" height="300" alt="" />
             ',
  1 => '<img src="image2.jpg" width="590" height="300" alt="" />
              ',
);
$options = array (
  'visible' => 1,
'scroll' => 1,
);
print theme('jcarousel', array('items' => $items, 'options' => $options));
cristian.stoica’s picture

I've got it from a related post as the code in the README could not ever work as the UL element has a call to an id that's not loaded yet. I'll have a play with your code, now is my turn to ask where did you get that :) as I've spent the last two hours trying to find a meaningful documentation for this module.
Thanks for your reply.

Michiel M-effect’s picture

I don't really remember :)
It's the code I use at my site but i don't know where i found it when i started using the module.
Let me know if it works for you.
I just realised you are using Drupal 6, and I am using Drupal 7. So i can imagine it doesn't work for you but i'm not sure

quicksketch’s picture

This question is about using the jCarousel library API (at least from the original post it looks that way). See the README.txt and admin/help/jcarousel pages for information on how to use the jCarousel module through the Drupal API.

I've got it from a related post as the code in the README could not ever work as the UL element has a call to an id that's not loaded yet.

The code you've listed is not in the current README.txt, sounds like it's from the 1.x version of the jCarousel module. The API has changed since 1.x and old instructions will not work.

quicksketch’s picture

Title: Not working » My custom code is not working
Status: Active » Fixed

I'm going to mark this fixed, please see the examples included with the module at admin/help/jcarousel. Reopen if you have troubles with those samples.

Status: Fixed » Closed (fixed)

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