所有人,
这里是我正在撰写的一篇发言稿。
WHAT IT DOES: When the blue button is pressed, a div should appear on top of the box containing the 5000 number.
我面临的问题是使用内装的超文本和安放;向有活力的零件分配补助。 我没有在火焰中发现任何错误,因此我不敢确定什么/什么是错的。
问题方针:
eCreditTransactions[i].id = ("trans" + i);
eCreditTransactions[i].innerHTML = <div class="cCreditContainer"><span class="cCreditsNo">-50</span> <img class="cCurrency" src="" alt="" /></div><span class="cCloseMsg">Click box to close.</span><div class="dots"></div><div class="dots"></div><div class="dots"></div> ;
这里是一部完整的法典:
var eCreditSystem = document.getElementById("creditSystem");
var i = 0;
var eCreditTransactions = new Array(6); // 6 instances created which will be recycled
function createCreditTransaction () // func called when a transaction occurs, at the mo, attached to onclick()
{
if (i < 6)
{
$(eCreditTransactions[i]).remove();
eCreditTransactions[i] = undefined; // to delete the existing data in the index of array
addingElements (i); // calling function
} else
if (i > 5 || eCreditTransactions[i] != undefined)
{
i = 0;
$(eCreditTransactions[i]).remove();
eCreditTransactions[i] = undefined;
console.log(eCreditTransactions[i]);
addingElements (i);
}
}
function addingElements (arrayIndex) // func called from within the createCreditTransaction() func
{
console.log(eCreditTransactions[i]);
eCreditTransactions[i] = $(document.createElement( div )).addClass("cCreditTransaction").appendTo(eCreditSystem);
// the problem area
eCreditTransactions[i].id = ("trans" + i);
eCreditTransactions[i].innerHTML = <div class="cCreditContainer"><span class="cCreditsNo">-50</span> <img class="cCurrency" src="" alt="" /></div><span class="cCloseMsg">Click box to close.</span><div class="dots"></div><div class="dots"></div><div class="dots"></div> ;
console.log(eCreditTransactions[i]);
return i++;
}