我使用Sorgilla jcarousel,只是想知道为什么只有在Google Chrome中,当我放大或缩小时,而不是100%时,旋转木马的位置是完全关闭的。我不确定要发布的具体代码,但这里是2个被调用的旋转木马。两者都有相同的问题。我假设这与像素没有调整大小或其他什么有关,但这在其他浏览器中不是问题。
任何帮助都是非常感谢的。
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('#mycarousel').jcarousel({
start: 2, // Configuration goes here
wrap: "circular",
scroll: 1,
auto:7
});
});
jQuery(document).ready(function() {
jQuery('#top-carousel').jcarousel({
start: 2, // Configuration goes here
wrap: "circular",
auto: 12,
scroll: 1
});
});
</script>发布于 2013-04-03 22:12:06
您可以使用适合我的变通方法。这不是最好的解决方案,你可以尝试改进它。下面是更改代码的方法
jQuery(document).ready(function() {
var animation = $.browser.safari ? null : "normal";
jQuery('#mycarousel').jcarousel({
start: 2, // Configuration goes here
wrap: "circular",
scroll: 1,
auto:7,
animation: animation,
itemLoadCallback: {
onBeforeAnimation: function (instance) {
if ($.browser.safari) {
var itemPos = instance.first;
var pageWidth = instance.container.width();
var expectedItemPos = pageWidth * (1 - itemPos);
instance.container.prevObject.animate({ "left": expectedItemPos + "px" });
}
}
}
});
});上面的代码用于从左到右的轮播。有关jcarousel配置的其他信息,您可以在here中找到
https://stackoverflow.com/questions/13993264
复制相似问题