我使用了兩個不同的jQuery插件;一個用於新聞徽標自動收報器,另一個用於水平文本滑塊。我該如何解決這個jQuery插件衝突?
,但其中只有一個是在的時候,在單頁使用的可能是因爲jQuery衝突的時候工作。如果我評論的第一個插件插件第二工作正常,反之亦然。
下面是代碼:
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.newsticker.js"></script>
<script type="text/javascript">
jQuery(document).ready(
function()
{
jQuery("#news").newsTicker();
jQuery("#development").newsTicker();
}
);
</script>
<link href="css/style.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="plugins/image_slider/css/sliderman.css" />
<link type="text/css" href="css/humanity/jquery-ui-1.8.13.custom.css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery-1.5.1.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.13.custom.min.js"></script>
<script type="text/javascript">
jQuery(function(){
jQuery("#accordion").accordion({ header: "h3" });
});
</script>
<link rel="stylesheet" href="css/news.css" type="text/css" media="screen">
<script src="js/jcarousellite_1.0.1c4.js" type="text/javascript">
</script>
謝謝!
什麼是衝突? – Ibu
不依賴於主jQuery庫的'jquery.newsticker.js'?首先加載基礎庫 – Ibu
thanx ibu ... !!!!!加載基礎庫。首先和輕微的變化出來的結果.. –