开发者

jcarousel ie7 issue

开发者 https://www.devze.com 2023-03-23 02:35 出处:网络
I am having an issue with the jquery jcarousel plugin. If I don\'t use the \"itemFallbackDimension\" property I get an error that says \"jCarousel: No width/height set for items. This will cause an in

I am having an issue with the jquery jcarousel plugin. If I don't use the "itemFallbackDimension" property I get an error that says "jCarousel: No width/height set for items. This will cause an infinite loop. Aborting...". If I do use the property I don't get any Javas开发者_如何学Gocript errors but all of the images stack vertically, they are not restricted in neither height nor width. When I press the next button they all scroll off the page.

Here is my code:

$(document).ready(function() {
$('#slideshow').jcarousel({
    scroll: 1,
    initCallback: mycarousel_initCallback,
    // This tells jCarousel NOT to autobuild prev/next buttons
    buttonNextHTML: null,
    buttonPrevHTML: null,
    itemLoadCallback: mycarousel_itemLoadCallback, //this is for loading the images via ajax
    itemFallbackDimension: 200, //stupid ie7 needs a fallback dimension
    visible: 1,
    vertical: false
});
});


The itemFallback is only used if the dimensions can't be detected for some reason, that seems to be the case in ie7 so it uses the fallback. If you don't provide one, you get the error. So something is wrong with your css.

You need to set the width and height of the first parent of the carousel, This could give you the same error. See this blog post

0

精彩评论

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