Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/362.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 手风琴坏了。控制台中未显示任何错误_Javascript_Jquery_Html - Fatal编程技术网

Javascript 手风琴坏了。控制台中未显示任何错误

Javascript 手风琴坏了。控制台中未显示任何错误,javascript,jquery,html,Javascript,Jquery,Html,我在一个站点上设置了一个ddaccordion,但由于某些原因它无法工作。它一直开着。 我已检查是否调用了正确的库,并且在控制台中没有看到任何错误记录 我使用网站上使用的html、css和脚本设置了一个fiddle,但在那里也不起作用,这排除了与其他javascript或jquery的冲突。 小提琴可以在这里找到 使用的脚本取自ddaccordion网站上的演示,并且 ddaccordion.init({ headerclass: "submenuheader", //Shared CSS cl

我在一个站点上设置了一个ddaccordion,但由于某些原因它无法工作。它一直开着。 我已检查是否调用了正确的库,并且在控制台中没有看到任何错误记录

我使用网站上使用的html、css和脚本设置了一个fiddle,但在那里也不起作用,这排除了与其他javascript或jquery的冲突。 小提琴可以在这里找到

使用的脚本取自ddaccordion网站上的演示,并且

ddaccordion.init({
headerclass: "submenuheader", //Shared CSS class name of headers group
contentclass: "submenu", //Shared CSS class name of contents group
revealtype: "mouseover", //Reveal content when user clicks or onmouseover the header? Valid value: "click", "clickgo", or "mouseover"
mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
collapseprev: true, //Collapse previous content (so only one open at any time)? true/false 
defaultexpanded: [], //index of content(s) open by default [index1, index2, etc] [] denotes no content
onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed)
animatedefault: false, //Should contents open by default be animated into view?
persiststate: true, //persist state of opened contents within browser session?
toggleclass: ["", ""], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
togglehtml: ["suffix", "<img src='plus.gif' class='statusicon' />", "<img src='minus.gif' class='statusicon' />"], //Additional HTML added to the header when it's collapsed and expanded, respectively  ["position", "html1", "html2"] (see docs)
animatespeed: "fast", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow"
oninit:function(headers, expandedindices){ //custom code to run when headers have initalized
    //do nothing
},
onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
    //do nothing
}
})
ddaccordion.init({
headerclass:“submenuheader”,//headers组的共享CSS类名
contentclass:“子菜单”//内容组的共享CSS类名
revealtype:“mouseover”//当用户在标题上单击鼠标时显示内容?有效值:“click”、“clickgo”或“mouseover”
mouseoverdelay:200,//如果revealtype=“mouseover”,则在标头在mouseover上展开之前以毫秒为单位设置延迟
collapseprev:true,//折叠以前的内容(因此在任何时候只打开一个)?true/false
defaultexpanded:[],//默认打开的内容索引[index1、index2等][]表示没有内容
onemustopen:false,//指定是否至少有一个标头应始终打开(因此从不关闭所有标头)
animatedefault:false,//默认情况下打开的内容是否应动画显示到视图中?
persiststate:true,//浏览器会话中打开内容的持久状态?
toggleclass:[“”,”“],//收拢和展开标头时将应用于标头的两个CSS类,分别为[“class1”,“class2”]
togglehtml:[“后缀”、“”、“”]、//分别在收拢和展开标题时向标题添加额外的HTML[“位置”、“html1”、“html2]”(请参阅文档)
animatespeed:“快”//动画速度:以毫秒为单位的整数(即:200),或关键字“快”、“正常”或“慢”
oninit:function(headers,expandedindices){//在头初始化时运行的自定义代码
//无所事事
},
onopenclose:函数(头、索引、状态、isuseractivated){//在打开或关闭头时运行的自定义代码
//无所事事
}
})

知道是什么导致手风琴失败吗?

参考错误:未定义ddaccordion

  • Zencart不支持https。即使链接更改为https,它也不会工作。引用错误仍然存在,因为内容不会通过不可信的证书加载
  • 该脚本使用document.write(当我将ddaccordianscript复制到fiddle JS区域时,发现了document.write)
  • 在提交问题之前,确保问题的“基础结构”工作正常,这样用户就可以帮助查找代码中的错误,而不是JSFIDLE的问题

  • 刚刚更新了fiddle,因为它是通过http而不是https查找文件的。我不知道您对zen cart了解多少,但显然不是它支持https的基本事实。它是在configure.php文件中定义的!关于这个问题,我实际上是指JSFIDLE抱怨文件是通过http而不是https提供的。尝试自己将http url添加到外部文件,您将看到它生成的错误消息。[]您已选中不生成证书错误的。