admin管理员组

文章数量:1327843

I have been banging my head for hours on this. I have jCarousel set up almost identically to their "simple" example, and I'm not getting any scrolling. If you set the width of the container higher, you can see that all the images are stacked on top of each other vertically rather than horizontally, but the UL is taking the proper "horizontal" class.

Help!

/

I have been banging my head for hours on this. I have jCarousel set up almost identically to their "simple" example, and I'm not getting any scrolling. If you set the width of the container higher, you can see that all the images are stacked on top of each other vertically rather than horizontally, but the UL is taking the proper "horizontal" class.

Help!

http://vermontgrapeandwinecouncil./eden-ice-cider-pany/

Share Improve this question asked Jun 29, 2009 at 4:49 AaronAaron 1
  • is this the carousel you are trying to fix? – Rony Commented Jun 29, 2009 at 5:04
Add a ment  | 

6 Answers 6

Reset to default 3

I have solved this issue. I had the UL set to display:none; and then a script setting it to show after the carousel loaded to prevent an awkward flash of unstyled content. Apparently, that was giving jCarousel some trouble calculating the widths of the items since the list was not displayed. Thanks, everyone.

I was having an issue getting the unstyled flash hidden during the page load with this plugin. The most simple fix for me was to apply a css value of visibility:hidden to the <ul> element then remove that css value after jCarousel loaded. Applying visibility:hidden rather than display:none allowed the correct widths of the <li> elements to be calculated by the jCarousel plugin.

Thanks guys... this worked for me

  jQuery(document).ready(function() {
            $('#<%=myImagecarousel.ClientID%>').jcarousel();
            $('#<%=myImagecarousel.ClientID%>').removeAttr('style');
            $('#<%=myImagecarousel.ClientID%>').show();
        });

The ul containing everything is set far too narrow. Expand it, or try removing the width altogether.

You have a ul with id "carousel" that has an inline style with width: 110px.
Try taking that width declaration out or making it larger.

Are you sure your jcarousel declaration is getting called?

I see you are declaring using this:

(function($) {
 $(function() {
 $('#carousel').jcarousel();
 $('#carousel').show();
 });
})(jQuery)

Try taking the inside function out to make it look like:

(function($) {
 $('#carousel').jcarousel();
 $('#carousel').show();
})(jQuery)

The reason I say this is because if I call $('#carousel').jcarousel() in firebug, it works correctly.

本文标签: javascriptjCarousel not workingStack Overflow