为了在我的主页上实现滑块效果,我下载了 Wowslider。在magento后端:我主页的内容部分(CMS->PAGES),我粘贴了以下代码:
<!-- Start WOWSlider.com BODY section -->
<script type="text/javascript">// <![CDATA[
var $j = jQuery.noConflict();
$j(document).ready(function() {
$j('#s3slider').s3Slider({
timeOut: 4000
});
});
// ]]>
</script>
<div id="wowslider-container1">
<div class="ws_images">
<ul>
<li><img id="wows0" title="Blue hills" src="data1/images/blue_hills.jpg" alt="Blue hills" /></li>
<li><img id="wows1" title="Sunset" src="data1/images/sunset.jpg" alt="Sunset" /></li>
<li><img id="wows2" title="Water lilies" src="data1/images/water_lilies.jpg" alt="Water lilies" /></li>
<li><img id="wows3" title="Winter" src="data1/images/winter.jpg" alt="Winter" /></li>
</ul>
</div>
<div class="ws_bullets">
<div><a title="Blue hills" href="#"><img src="data1/tooltips/blue_hills.jpg" alt="Blue hills" />1</a> <a title="Sunset" href="#"><img src="data1/tooltips/sunset.jpg" alt="Sunset" />2</a> <a title="Water lilies" href="#"><img src="data1/tooltips /water_lilies.jpg" alt="Water lilies" />3</a> <a title="Winter" href="#"><img src="data1/tooltips/winter.jpg" alt="Winter" />4</a></div>
</div>
<a class="wsl" href="http://wowslider.com">HTML Slideshow Code Generator by WOWSlider.com v2.1.3</a> <a class="ws_frame" href="#"></a></div>
<script src="engine1/wowslider.js" type="text/javascript"></script>
<script src="engine1/script.js" type="text/javascript"></script>
<!-- End WOWSlider.com BODY section -->
在page.xml中,下面最后一行代码是我自己添加的:
<block type="page/html_head" name="head" as="head">
<action method="addJs"><script>prototype/prototype.js</script></action>
<action method="addJs"><script>lib/ccard.js</script></action>
<action method="addJs"><script>prototype/validation.js</script></action>
<action method="addJs"><script>scriptaculous/builder.js</script></action>
<action method="addJs"><script>scriptaculous/effects.js</script></action>
<action method="addJs"><script>scriptaculous/dragdrop.js</script></action>
<action method="addJs"><script>scriptaculous/controls.js</script></action>
<action method="addJs"><script>scriptaculous/slider.js</script></action>
<action method="addJs"><script>varien/js.js</script></action>
<action method="addJs"><script>varien/form.js</script></action>
<action method="addJs"><script>varien/menu.js</script></action>
<action method="addJs"><script>mage/translate.js</script></action>
<action method="addJs"><script>mage/cookies.js</script></action>
<!--the following 1 line is added by myself -->
<action method="addItem"><type>skin_js</type><name>skin/frontend/newdefault/default/js/jquery.js</name></action>
结果是滑块在 Firefox 和 chrome 中工作,但在 IE 中不工作(它在 IE 中是静态的,只显示 1 个图像)
我也尝试过其他插件来实现滑动效果,所有插件似乎都可以在 firefox 或 Chrome 中运行,但在 IE 中却不行。