Jcarousel lite在safari和chrome中没有显示页面加载

时间:2021-12-19 19:43:58

I have this plug-in in use on my home page which is running on WAMP. It works great in every browser except Safari and Google Chrome. In those browsers the carousel doesn’t show up when I first load the page, nor when I hit reload. When I navigate to the home page via the on page navigation link then it shows up.

我在我的主页上使用了这个插件,它在WAMP上运行。它适用于除Safari和Google Chrome之外的所有浏览器。在那些浏览器中,当我第一次加载页面时,轮播不会显示,也不会在重新加载时显示。当我通过页面导航链接导航到主页时,它会显示出来。

Any ideas what could be causing this?

可能导致这种情况的任何想法?

Thanks, Jeremy

4 个解决方案

#1


Had this problem too, found that by giving the pictures i was displaying a width="nn px" and height="nn px" solved my problem ;)

也有这个问题,发现通过给出图片我显示宽度=“nn px”和高度=“nn px”解决了我的问题;)

#2


Try putting your gallery initialization in the window load function, something like so:

尝试将您的图库初始化放在窗口加载函数中,如下所示:

$(window).load(function() {

    $(".gallery").jCarouselLite({
        btnNext: ".next",
        btnPrev: ".prev",
    });
});

#3


I faced the similar issue. Make sure you are giving width and height to your images. For some reason google chrome and safari are not fetching/calculating the height/width automatically.

我遇到了类似的问题。确保为图像提供宽度和高度。由于某些原因,谷歌浏览器和safari不会自动获取/计算高度/宽度。

#4


Similar to what user703735 said above. I found by forcing a height and width of my scrolling images it would bypass jcarousel trying to calculate them. I also found it caused a few issues with IE8 without values so this may help someone else with the same issue.

类似于user703735上面所说的。我发现通过强制滚动图像的高度和宽度,它会绕过jcarousel试图计算它们。我还发现它导致IE8没有值的一些问题,所以这可能会帮助其他人有同样的问题。

<li style="width: XXpx; height: XXpx;"> ... image here ... </li>

Where XX is the size in pixels.

其中XX是像素的大小。

#1


Had this problem too, found that by giving the pictures i was displaying a width="nn px" and height="nn px" solved my problem ;)

也有这个问题,发现通过给出图片我显示宽度=“nn px”和高度=“nn px”解决了我的问题;)

#2


Try putting your gallery initialization in the window load function, something like so:

尝试将您的图库初始化放在窗口加载函数中,如下所示:

$(window).load(function() {

    $(".gallery").jCarouselLite({
        btnNext: ".next",
        btnPrev: ".prev",
    });
});

#3


I faced the similar issue. Make sure you are giving width and height to your images. For some reason google chrome and safari are not fetching/calculating the height/width automatically.

我遇到了类似的问题。确保为图像提供宽度和高度。由于某些原因,谷歌浏览器和safari不会自动获取/计算高度/宽度。

#4


Similar to what user703735 said above. I found by forcing a height and width of my scrolling images it would bypass jcarousel trying to calculate them. I also found it caused a few issues with IE8 without values so this may help someone else with the same issue.

类似于user703735上面所说的。我发现通过强制滚动图像的高度和宽度,它会绕过jcarousel试图计算它们。我还发现它导致IE8没有值的一些问题,所以这可能会帮助其他人有同样的问题。

<li style="width: XXpx; height: XXpx;"> ... image here ... </li>

Where XX is the size in pixels.

其中XX是像素的大小。