且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将jQuery代码转换为mootools 1.11

更新时间:2023-02-16 21:22:43

将'$'保留在基于mootools的代码中.并为您的jQuery代码使用"jQueryDollar".添加了jQuery库之后,请使用以下命令:

Leave the '$' for your mootools based code as it is. And Use 'jQueryDollar' for your jQuery codes. After adding the jquery library, use this :

<script src="jquery.js"></script>
<script>
var jQueryDollar = jQuery.noConflict();
// Do something with 'jQueryDollar'
jQueryDollar(document).ready(function(jQueryDollar) {
    jQueryDollar('.rgstitle, .rgsdescription').click(function(event) {
        window.open(jQueryDollar('#rgslideshow-4574 a img:visible').parent().attr('href'), '_self');    
        return false;
    });
});
</script>

现在在下面添加mootools库:

Now add mootools libraries just beneath:

 <script src="mootools.js"></script>
 <script>
     //'$' is now free for mootools
 </script>