大家好,我在 BigCartel.com 上经营一家商店。最近我决定将 jQuery slider 合并到我的商店中。我选择了它而不是闪存,这样它就可以与我的客户的 Apple 移动设备兼容。不幸的是,我在让它在 IE 中运行时遇到了一些问题。目前,它在 Chrome、FF 和 Safari(我担心的其他主要浏览器)中运行得很好。我想我也许能够在这里找到一些有效的帮助,而不是把头撞在墙上继续试图解决这个问题。
你可以看到我的网站 www.StarboardClothing.com 。我正在使用的 slider 名为“Infinite Carousel”,可在 Catch My Fame 上找到。 .
这是我当前使用的代码:
在布局页面的部分(应用于网站上的所有其他页面)中,我有以下代码。
<小时/>{% if page.permalink == 'home' %}
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript" src="http://sliderfiles.starboardclothing.com/jquery.infinitecarousel2.min.js"></script>
<script type="text/javascript">
$.noConflict();
</script>
<script type="text/javascript">
jQuery(function(){
jQuery('#carousel').infiniteCarousel({
transitionSpeed: 2000,
displayTime: 6000,
inView:1,
advance:1,
imagePath: 'http://sliderfiles.starboardclothing.com/',
textholderHeight : .25,
padding:'10px',
autoHideCaptions: true,
prevNextInternal: true,
displayThumbnailNumbers: false,
displayThumbnailBackground: false,
thumbnailWidth: '10px',
thumbnailHeight: '10px',
autoHideControls: true,
displayProgressBar: false,
easeLeft: 'swing',
easeRight: 'swing'
});
jQuery('div.thumb').parent().css({'margin':'0 auto','width':'60px'});
jQuery('#carouselWrapper > div:eq(1)').css('margin-top','56px');
jQuery('#carouselWrapper > div:eq(2)').css('margin-top','56px');
});
</script>
{% endif %}
<小时/>
然后,我在我的网站上实际实现该插件的部分中包含以下代码。这使得它在 IE 中具有一定的功能。在添加该包装器之前,它在 IE 中根本无法运行。此时它只是一个最小的功能,并且该插件在玩完一次后就会崩溃。尽管这些控件在其他主要浏览器中可以正常工作,但目前没有一个控件可以在 IE 中工作。
<小时/><div class ="iframe-wrapper">
<div id="carousel">
<ul>
<li><a href="http://www.starboardclothing.com"><img alt="" src="http://sliderfiles.starboardclothing.com/annapolis-splash3.jpg" width="648" height="302" /></li>
<li><a href="http://www.starboardclothing.com/artist/spring-line-2011"><img alt="" src="http://sliderfiles.starboardclothing.com/spring-line.jpg" width="648" height="302" /></li>
</ul>
</div>
</div>
<小时/>
如果有人能帮助我在 IE 中实现此功能,我将非常感激。我知道可以在 IE 中工作。我特别选择这个插件的部分原因是它可以在创建者网站上的 IE 中运行。我很乐意尝试实现您可能提出的任何建议,并让您知道结果。提前致谢。
最佳答案
它似乎可以在 IE9 中运行,至少在我的机器上是这样。然而,IE9 确实在 ?live-comment-preview.js
第 1 行第 1 列抛出“语法错误”(注意问号):
那里有一个链接到 http://www.catchmyfame.com/?live-comment-preview.js这可能真的指向 http://www.catchmyfame.com/live-comment-preview.js :
<p style="display: none;"><input type="hidden" id="akismet_comment_nonce" name="akismet_comment_nonce" value="48264cb9eb" /></p><script src="http://www.catchmyfame.com/?live-comment-preview.js" type="text/javascript"></script><div id="commentPreview"></div>
我无法再访问早于 IE9 的 IE 版本,因此无法帮助您解决这些问题 - 可能是此语法错误阻止旧版 IE 加载您的 carrousel。
关于javascript - 无限轮播无法在 IE 中正确加载,但可在 Chrome、Safari 和 FF 中正常运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5417200/