2016-09-16 390 views
1

我得到「對象不支持屬性或方法'最接近'」在IE中的錯誤。我正在使用MooTools。誰能幫我..IE:對象不支持屬性或方法'最接近'

var li = $$('.list')[0].clone(true, true); 

var NewContainer = li.getElement('div.tile'); 

NewContainer.removeProperty('style'); 

NewContainer.set('id', 'container_'+catId); 

NewContainer.closest('li').set('id', 'list_'+countID); 
+0

這個方法'li.getElement('div.tile')'返回什麼? – brk

+0

@ user2181397:它返回具有class'tile'的html div元素 –

+0

T.J.克勞德:你說得對。我正在使用MooTools。 –

回答

1

MooTools沒有closest。你可能想getParent(它接受一個用於查找祖先的選擇器),但不像jQuery的closest它不看當前元素(我不認爲這是一個問題)。

但請注意,您已經,在可變liliNewContainer參考。

+0

優秀!有用!非常感謝... –

相關問題