我在我的页面上使用了 Jquery Pikachoose 插件来展示一些图片作为幻灯片。
但是在IE中,它不会滑动图片,反而在同一页中以完整视图打开图片。
有趣的是,如果在脚本打开图片之前,我自己通过点击缩略图更改幻灯片,那么从这点开始,它就能正常工作。
如何修复这个问题。
我从数据库获取图片名称并像以下方式显示:
echo
'<div id="slideShow" class="sublayout pikachoose">
<ul id="pikame">';
while($row = mysql_fetch_array($result)) {
extract($row);
echo
'<li>
<a href="images/slideshow/'.$image.'">
<img src="images/slideshow/th_'.$image.'" title='.$title.' alt='.$title.'/>
</a>
<span>'.$title.'</span>
</li>';
}
echo
'</ul>
</div>';
这是我在 pikachoose.js
中的 pikachoose 选项
var defaults = {
show_captions: true,
auto_play: true,
show_prev_next: true,
slide_speed: 5000,
thumb_width: 26,
thumb_height: 20,
buttons_text: { play: "", stop: "", previous: "Previous", next: "Next" },
delay_caption: true,
user_thumbs: false,
transition:[-1],
IESafe: true
};
我使用以下代码进行插件初始化 (也在单独的文件中)
$(document).ready(function (){ $("#pikame").PikaChoose({auto_play:true, IESafe: true}); });
在其他浏览器中可以正常工作。
发现
- 如果我删除
<a>
这个标签,<img>
就不会被打开。 - 官方页面提供的演示也有这样的行为。