如何在mootools的jquery中执行相同的功能/功能

时间:2011-09-30 03:21:31

标签: jquery mootools

//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动态库。

谢谢,

1 个答案:

答案 0 :(得分: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');