我在一个页面中使用了jquery cycle插件和flexdropdown ...发生的情况是两个插件中的一个正在工作,而不是两个都有效。
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="http://cloud.github.com/downloads/malsup/cycle/jquery.cycle.all.latest.js"></script>
<script type="text/javascript" src="js/flexdropdown.js"></script>
<script type="text/javascript">
$.fn.cycle.defaults.speed = 900; // Error: $ is undefined
$.fn.cycle.defaults.timeout = 6000;
$(function() {
// run the code in the markup!
$('#demos pre code').each(function() {
eval($(this).text());
});
$('#twitter-widget').twitterSearch({
term: 'cycle plugin',
title: 'Cycle Chatter',
titleLink: 'http://www.twitter.com/malsup',
birdLink: 'http://www.twitter.com/malsup',
css: { img: { width: '30px', height: '30px' } }
});
$('#twitter-widget .twitterSearchTitle a, .twitterSearchBird').attr('title','Follow Me');
});
</script>发布于 2010-07-03 18:44:37
您可以看看using jQuery with other libraries和$函数。
发布于 2010-07-03 18:54:24
您包含js文件的顺序是错误的,或者两个js都有冲突数据,请查看这个-http://api.jquery.com/jQuery.noConflict/,以解决此问题
https://stackoverflow.com/questions/3171217
复制相似问题