2011-09-30 87 views
0
//new tmp element that contains the new div 
var tmpDiv = new Element('div',{html:'<div id="video"><iframe title="YouTube video player" width="370" height="208" src="'+video+'" frameborder="0" allowfullscreen></iframe></div>'}); 
//new div (first child of my tmp div) replaces the old 'myDiv' (that can be grabbed from the DOM by $) 
tmpDiv.getFirst().replaces($('video')); 


$$('.showing').removeClass('showing'); 
$('thumb-' + id).addClass('showing'); 

我該如何將其轉換爲jQuery?我相信它正在使用mootools動態庫。如何在mootools的jquery中執行相同的功能/函數

感謝,

回答

0

如果我讀這個權利,我覺得這是你在找什麼:

$("#video").replaceWith('<div id="video"><iframe title="YouTube video player" width="370" height="208" src="'+video+'" frameborder="0" allowfullscreen></iframe></div>'); 

$('.showing').removeClass('showing'); 
$('#thumb-' + id).addClass('showing');