Jquery 幻灯片放映的问题
我熬夜只是想解决 JQuery 幻灯片,但我不确定为什么它没有按预期工作。我忘了拍下这个例子,但现在我的笔记本电脑不在身边,所以如果你需要看这个例子,我会在几个小时后发布。
我借用了插件的功能: http://medienfreunde.com/lab/innerfade/
<script>
jQuery.noConflict();
$(document).ready( function(){
$('li#slider_reel').innerfade({
animationtype:'fade',
speed: 'slow',
timeout: 4000,
type: 'sequence',
containerheight: '648px'; });
});
</script>
<div id="slider_view">
<div id="slider_reel">
<ul>
<li><img src="slide/A.jpg"></li>
<li><img src="slide/B.jpg"></li>
<li><img src="slide/C.jpg"></li>
<li><img src="slide/D.jpg"></li>
</ul>
</div>
</div>
<!--end reel-->
ul#slider_reel li img{
border: 1px solid #ccc;
padding: 4px;
}
.fade{
margin-bottom: 2em;
}
.fade p{
margin-bottom: 2em;
text-align: center;
width: 100%;
background: #fff;
}
结果:所有图像以长的垂直顺序出现(就像彼此堆叠或一堆一样)。无法弄清楚为什么它会这样。预先感谢您的帮助
编辑 我的歉意。它确实有 ul 和 li - 我忘了将它们添加到里面。得到了相同的结果。
编辑二 我终于让它工作了。我想我错过了一些“}”或其他东西,而且我用实际文件而不是 href 替换了脚本。
非常感谢您的帮助!
I stayed up all night just trying to resolve the JQuery slideshow but I am not sure why it is not working as expected. I forgot to snap the example but right now my laptop is not with me, so I will post later in several hours' time, if you need to see the example.
i borrowed plugin's function: http://medienfreunde.com/lab/innerfade/
<script>
jQuery.noConflict();
$(document).ready( function(){
$('li#slider_reel').innerfade({
animationtype:'fade',
speed: 'slow',
timeout: 4000,
type: 'sequence',
containerheight: '648px'; });
});
</script>
<div id="slider_view">
<div id="slider_reel">
<ul>
<li><img src="slide/A.jpg"></li>
<li><img src="slide/B.jpg"></li>
<li><img src="slide/C.jpg"></li>
<li><img src="slide/D.jpg"></li>
</ul>
</div>
</div>
<!--end reel-->
ul#slider_reel li img{
border: 1px solid #ccc;
padding: 4px;
}
.fade{
margin-bottom: 2em;
}
.fade p{
margin-bottom: 2em;
text-align: center;
width: 100%;
background: #fff;
}
The result: all images appear in long vertically order (just like stack or pile to one another). Couldn't figure why it is behaving like this. Thank you in advance for your help
EDIT
My apologises. It did have ul and li - i forgot to add them inside. got the same result.
EDIT II
I finally got it working. i think i missed some '}' or something and also I replaced the script with actual file instead of href.
Thank you so much for your help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我已经让它工作了,
http://jsfiddle.net/BceNn/6/
问题之一:
编辑:这里正在工作代码。
I have got it working,
http://jsfiddle.net/BceNn/6/
One of the problems:
EDIT: Here is working code.
修复您的选择器,其中没有 UL 或 LI,然后重试
fix your selectors there is not ULs nor LIs then try again
问题可能就在这里,在你的 CSS 中:
复制+粘贴代码不是一个好主意。此规则根本不适用,因为您没有任何
id
为slider_reel
的ul
元素。您有div
标签。我会尝试事先隐藏图像,然后运行它:
The problem is probably here, in your CSS:
Copy + pasting code isn't a good idea. This rule isn't applied at all, as you don't have any
ul
element with anid
ofslider_reel
. You havediv
tags.I'd try hiding the images beforehand, then running it: