开发者

jQuery("#myCarousel").jcarousel is not a function?

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').jcarous开发者_运维知识库el({
        // Configuration goes here
    });
});
</script> and in results.aspx i have the following <p> <ul id="myCarousel" class="jcarousel-skin-tango"><% foreach..... %></ul></p>


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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜