ACP
ACP

Reputation: 35268

Using two jquery plugins in one page doesn't seem to work

I am using a jquery cycle plugin and flexdropdown in one page... What happens is either one of the plugin is working but not both....

<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>

Upvotes: 0

Views: 2881

Answers (2)

Mayur Birari
Mayur Birari

Reputation: 5835

either your sequence of including js files are wrong or both js has a conflict data ,take look at this-http://api.jquery.com/jQuery.noConflict/,to resolve this issue

Upvotes: 0

Darin Dimitrov
Darin Dimitrov

Reputation: 1038820

You may take a look at using jQuery with other libraries and the $ function.

Upvotes: 1

Related Questions