我正在尝试在我的样式指南中循环部分数组,但我得到的只是部分名称而不是实际的部分名称。
这是我的数据:
function swap(test){
if(test==2){
document.getElementById("top").innerHTML = "<img src=\"_images/"+showList[showIndex][3]+".jpg\" width=\"400\" />"; // Sets top invisible div to old picture
showIndex++;
var elem = document.getElementById("top");
elem.style.transition = "";
elem.style.opacity =1; // makes old picture visible
document.getElementById("bottom").innerHTML = "<img src=\"_images/"+showList[showIndex][3]+".jpg\" width=\"400\" />";
} // Set's bottom div to New picture
setTimeout(function(){
var elem = document.getElementById("top");
elem.style.transition = "opacity 0.5s linear 0s";
elem.style.opacity = 0; // fades out top picture to reveal new bottom pic.
}, 5000);//here time interval is 5 seconds
}
这是我的汇编代码:
{"omnijoin-components": [
{
"id": "accordion",
"component": "omnijoin-accordion"
},
{
"id": "banner",
"component": "omnijoin-banner"
},
{
"id": "benefits",
"component": "omnijoin-benefits"
}]}
这会出错,因为它试图找到this.component而不是实际的部分名称。
这可能与汇编有关吗?
谢谢