2017-01-30 42 views
0

Lightslider Jquery代碼和mootols不能一起工作,如果我刪除jquery api代碼,所以mootools工作,否則,如果我把jquery api代碼,那麼lightlider工作(它使用jquery),但mootools不工作,然後。Lightslider和mootols不能一起工作,

Mootools的

<script language="javascript" type="text/javascript" src="/script/mootools-1.2.1-core.js"></script> 
<script language="javascript" type="text/javascript" src="/script/mootools-1.2-more.js"></script> 
<script language="javascript" type="text/javascript" src="/script/slideitmoo-1.1.js"></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: 5, 
      elemsSlide: 2, 
      duration: 150, 
      itemsSelector: '.SlideItMoo_element', 
      itemWidth: 158, 
      showControls:1}); 
    }, 

    }); 
</script> 

Lightslider

<link rel="stylesheet" type="text/css" href="/stylesheet/lightslider.css" /> 
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js'></script> 
    <script src="/script/lightslider.js"></script> 
    <script> 
     $(document).ready(function() { 
      jQuery("#content-slider").lightSlider({ 
       loop:true, 
       auto: true, 
       keyPress:true 
      }); 
     }); 
    </script> 
+1

[jQuery和MooTools的衝突]的可能的複製(http://stackoverflow.com/questions/2810399/jquery-and-mootools-conflict) –

+0

你能解釋還是指出? – Atif

回答

0

我得到了我的解決方案我試圖自己則工作。

只需要改變兩件事情之一API鏈接位置第2 $將是jQuery的

像這樣

<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js'></script> 

<script language="javascript" type="text/javascript" src="/script/mootools-1.2.1-core.js"></script> 
<script language="javascript" type="text/javascript" src="/script/mootools-1.2-more.js"></script> 
<script language="javascript" type="text/javascript" src="/script/slideitmoo-1.1.js"></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: 5, 
      elemsSlide: 2, 
      duration: 150, 
      itemsSelector: '.SlideItMoo_element', 
      itemWidth: 158, 
      showControls:1}); 
    }, 

    }); 
</script> 

<link rel="stylesheet" type="text/css" href="/stylesheet/lightslider.css" /> 
    <script src="/script/lightslider.js"></script> 
    <script> 
     jQuery(document).ready(function() { 
      jQuery("#content-slider").lightSlider({ 
       loop:true, 
       auto: true, 
       keyPress:true 
      }); 
     }); 
    </script>