-3
發送參數我有這樣的代碼:jQuery的每個:如何與回調
$j(".attribute-option-images").each(closeSelectBox(index,el));
然後:
closeSelectBox = function(index,el)
{
// stuff
}
,但我得到的是:
Uncaught ReferenceError: index is not defined
所以如何將迭代的元素髮送到closeSelectBox
?
+1。由於問題的結論是*如何將迭代元素髮送到'closeSelectBox' *,有人可能會指出,這將在迭代器中作爲'this'訪問。 –