我使用了两个不同的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 ... !!!!!加载基础库。首先和轻微的变化出来的结果.. –