views:

168

answers:

2

I am new to jQuery. I am trying to use the example "simple" jCarousel in my asp.net pages. I have a top.master page that contains the head content which contains the javascript to setup myCarousel.

There are no spelling errors in myCarousel which is used in the setup section. Now when I use FireFox with firebug, as soon the script for setting up jCarousel is hit, it throws an error, jQuery("#myCarousel").jcarousel is not a function'

What am I doing wrong here? EDIT OK below is what goes to top.master

<script type="text/javascript">
    jQuery(document).ready(function() {
        jQuery('#myCarousel').jcarousel({
        // Configuration goes here
    });
});
</script> and in results.aspx i have the following <p> <ul id="myCarousel" class="jcarousel-skin-tango"><% foreach..... %></ul></p>
A: 

Functions should be written like this: jQuery("#myCarousel").jcarousel()

Make sure you have included the jcarousel script.

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

Also, make sure that your id is myCarousel and not mycarousel as they are case sensitive.

Vikash
Seems that is the way it is.
Wajih
+2  A: 

Make sure you are loading jQuery and jCarousel files correctly. =)

Laheab
Thats loaded OK for other things I do.
Wajih
I cant believe I had undone the loading of jquery.jcarousel.min.js!!!!! THANKS ANYWAY
Wajih