开发者

jquery and mootools together not working

I want to add one Mootools slider gallery in my page, but it can not work with other jQuery plugins. how to modify the javascript part? Thanks.

<script type="text/javascript">
var $jq = jQuery.noConflict();
$jq("img").lazyload({ 
    placeholder : "img/logo.png",
    event : "click"
});
</script>
<script language="javascript" type="text/javascript">
window.addEvents({
    'domready': function(){
    /* thumbnails example , div containers */
    new SlideItMoo({
        overallContainer: 'SlideItMoo_outer',
        elementScrolled: 'SlideItMoo_inner',
        thumbsContainer: 'SlideItMoo_items',
        itemsVisible:4,
        elemsSlide:3,
        duration:300,
        itemsSelector: '.SlideItMoo_element',
        itemWidth: 158,
        showControls:1,
        startIndex:5
        });
 开发者_如何学Python   }
});
</script>


Modify jQuery's code, let it runs at ondomready event and add noConfilict-ed jQuery to function, which you want run:

<script type="text/javascript">
$.noConflict();
jQuery(document).ready(function($) {
$("img").lazyload({ 
    placeholder : "img/logo.png",
    event : "click"
});
</script>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜