我想在我的页面中添加一个Mootools滑块库,但它无法与其他jQuery插件一起使用。如何修改javascript部分?感谢。
<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
});
}
});
</script>
答案 0 :(得分:1)
修改jQuery的代码,让它在ondomready事件中运行,并将noConfilict-ed jQuery添加到函数中,你想运行它:
<script type="text/javascript">
$.noConflict();
jQuery(document).ready(function($) {
$("img").lazyload({
placeholder : "img/logo.png",
event : "click"
});
</script>