尝试让这个(简单!)jQuery 表达式在 Mootools 中工作
Jquery:
checkCurrentModule = function(){
jQuery(".module ul li.current").prepend("<b class='arrow'></b>");
};
这是我在 Mootools 中的尝试
var checkCurrentModule = function(){
var injectModuleli = $$("li.current");
var currentArrow = new Element("<b class='arrow'></b>");
currentArrow.inject(injectModuleli);
};
最佳答案
提供一个单行解决方案,并且不依赖于 mootools-more:
$$('li.current').grab(new Element('b.arrow'), 'top');
(我只想将其添加为评论,但目前还不允许我这样做。)
关于javascript - Jquery 到 Mootools,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7768448/