2014-09-01 36 views
-6

我有網站,並希望在其中添加一些腳本。當我嘗試添加斜面因爲有兩個JavaScript的工作不在一起:兩個javascripts不能一起工作

我的HTML代碼

<head> 
     <link rel="stylesheet" type="text/css" href="http://2gdmedia.com/css/default.css" /> 
     <link rel="stylesheet" type="text/css" href="http://2gdmedia.com/css/component.css" /> 
     <script src="http://2gdmedia.com/js/modernizr.custom.js"></script> 
       <link rel="stylesheet" href="http://en.2gdmedia.com/reveal.css">  

     <!-- Attach necessary scripts --> 
     <!-- <script type="text/javascript" src="jquery-1.4.4.min.js"></script> --> 
     <script type="text/javascript" src="http://code.jquery.com/jquery-1.6.min.js"></script> 
     <script type="text/javascript" src="http://en.2gdmedia.com/jquery.reveal.js"></script> 
<script>$(document).ready(function() { 
    // trigger reveal manually. 
    $('#myModal').reveal({ 
    animation: 'fadeAndPop',     //fade, fadeAndPop, none 
    animationspeed: 300,      //how fast animtions are 
    closeonbackgroundclick: true,    //if you click background will modal close? 
    dismissmodalclass: 'close-reveal-modal' //the class of a button or element that will close an open modal 
    }); 
});</script> 
    </head> 

只有當我刪除此:

 <script type="text/javascript" src="http://code.jquery.com/jquery-1.6.min.js"></script> 

然後工作第一個JavaScript :),請幫助我,不會因爲我最近被禁止而降低這個問題的速度。先謝謝你。如果有任何細節需要提供我準備好評論:)

+0

標題是搞笑 – yuvi 2014-09-01 08:51:23

+1

偏離主題「請調試我的代碼問題」 - 如果您想獲得幫助更新您的代碼與具體的錯誤和問題,你有嘗試,你試過 – Evgeniy 2014-09-01 08:54:47

+0

嘗試把hte jQuery鏈接之上的所有其他鏈接到任何javascripts。包括Modernizr。 – Kyle 2014-09-01 08:54:59

回答

1

這可能是因爲jquery衝突。如果是這樣的話,使用noquflict的jquery.or或添加兼容版本的jquery到你的頁面。

如果不是這樣,那麼先添加jquery然後所有其他文件,看看。

相關問題