jQuery 错误 - 之后:函数
因此,使用 Cycle 插件继续我的 jQuery 工作,我遇到了一个新错误。
erros 说的是我的 jquery-1.3.2.min.js 文件的第 274 行,这是这一部分:
after: function() {
return this.domManip(arguments, false, function(elem){
this.parentNode.insertBefore( elem, this.nextSibling );
});
},
我假设这是由页面上使用的循环函数引起的:
<script type="text/javascript">
$(function() {
$('.slideshow').after('<div id="mininav" class="mininav">').cycle({
fx: 'fade',
speed: 'fast',
timeout: 5500,
pause: 1,
pager: '#mininav',
before: function() { if (window.console) console.log(this.src); }
});
});
</script>
此脚本位于 HTML 之上:
<div class="tabContainer slideshow">
<iw_iterate list="dcr.home.slideshow" var ='slideshow'>
<![CDATA[
<div class="tab current" style="background:#fff url({iw_value name='slideshow.image'/}) no-repeat top left;">
<div class="copy">
<h2>{iw_value name='slideshow.headline'/}</h2>
<p>{iw_value name='slideshow.text'/}</p>
</div>
</div>
]]></iw_iterate><![CDATA[
</div><!--/tabContainer-->
我能够利用这个脚本在另一页上,但我想知道它是否与我在内容管理系统中使用的动态迭代有关,该系统根据我的可视化编辑器中有多少条目创建“.slideshow”div...?哇哈哈
So continuing my jQuery efforts using the Cycle plugin, i have a new error.
erros says Line 274 of my jquery-1.3.2.min.js file, which is this section here:
after: function() {
return this.domManip(arguments, false, function(elem){
this.parentNode.insertBefore( elem, this.nextSibling );
});
},
I am assuming that is caused by my cycle function used on the page:
<script type="text/javascript">
$(function() {
$('.slideshow').after('<div id="mininav" class="mininav">').cycle({
fx: 'fade',
speed: 'fast',
timeout: 5500,
pause: 1,
pager: '#mininav',
before: function() { if (window.console) console.log(this.src); }
});
});
</script>
This script sits above the HTML:
<div class="tabContainer slideshow">
<iw_iterate list="dcr.home.slideshow" var ='slideshow'>
<![CDATA[
<div class="tab current" style="background:#fff url({iw_value name='slideshow.image'/}) no-repeat top left;">
<div class="copy">
<h2>{iw_value name='slideshow.headline'/}</h2>
<p>{iw_value name='slideshow.text'/}</p>
</div>
</div>
]]></iw_iterate><![CDATA[
</div><!--/tabContainer-->
I was able to utilze this script on another page, but i am wondering if it has to do with the dynamic iteration i use from my content management sytem, that creates the ".slideshow" divs based on how many entries i have in my visual editor...? BWAHHHH
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试关闭您正在创建的 div 标签:
或:
Try closing the div tag which you are creating:
or:
编辑:
不确定您的问题到底是什么,但这是一个工作jsFiddle 演示。
EDIT:
Not sure what exactly your issue is, but here is a working jsFiddle demo.