[jQuery] jCarousel objects
Greetings,
This seems like a simple question, but I haven't been able to find/
figure out an answer for it. I'm working with jCarousel, and would
like to know how to refer to a jCarousel object. Consider the
following example:
<script type="text/javascript">
$(document).ready(function() {
// create a new carousel
$('#mycarousel').jcarousel();
// add to this carousel
add_item_to_carousel(WHAT GOES HERE?);
// I've tried things like $('#mycarousel'), and '#mycarousel'
});
</script>
<script type="text/javascript">
// I'd like to call this method
function add_item_to_carousel(carousel)
{
var new_item = '<img src="http://static.flickr.com/
57/199481087_33ae73a8de_s.jpg" />';
var new_size = carousel.size()+1;
carousel.size(new_size);
carousel.add(new_size, new_item);
};
</script>
If anyone can help out with the "WHAT GOES HERE?", I'd really
appreciate it. Thanks!
-Steve