我要保存我創建了一個對象的引用,並調用我.append()的.style工作正常,但如果我嘗試做一個風格上的變化它不會允許我...可以使用.append(),而不是元素
我得到的錯誤是
Uncaught TypeError: Cannot set property 'display' of undefined
任何想法?
//add this slide's wrapper to module
self.node = $("<div id='module_"+self.moduleId+"-slide_"+self.currentSlide+"' class='slide fade'></div>").appendTo("div#module_"+self.moduleId);
//add the contents of the slide to its wrapper div
self.node.append(self.slides[self.currentSlide-1].html)
//Hack to force webKit to repaint (to have style fade applied) before the show() event.
self.node.style.display='none';
你可以發佈一個小提琴?你的self.node.append不會被終止。 – fauverism
或self.node [0]訪問底層對象 – JohnKiller
爲什麼@Adrift不回答這個問題嗎? – tetri