1
$('input.ISSelectSearch').each(function(i) {
var box = new Object;
box.size = 80;
box.width = 110;
//CODE CODE CODE
});
如何訪問在前一次迭代中設置的box
的值?或者,是否有可能通過某種類型的密鑰訪問它?在jQuery中訪問JS對象each()迭代器函數
$('input.ISSelectSearch').each(function(i) {
var box = new Object;
box.size = 80;
box.width = 110;
prevsize = $(this).box[/* previous iteration element id or name */].size
//CODE CODE CODE
});
的問題是,我需要知道與每個'input.ISSelectSearch'
元件盒相關聯的數據,這樣我可以取決於當前或先前框對象的值改變它們。換句話說,我需要元素框對象之間的連接,以便我可以根據另一個對象的值指定某些更改。
你確定你想要條件pre!= null嗎?在哪個迭代將不是null? – JeffS 2012-07-10 14:59:06
我想你想'pre = this'outside if if – mariusnn 2012-07-10 14:59:48
@mariusnn - thankx – 2012-07-10 15:00:50