Reputation: 39
I am using two different modules that both have jquery.min.js in my joomla site. They are conflicting on my homepage. How can I distinguish between them for the homepage and for the inside pages where the conflict does not occur?
Upvotes: 1
Views: 1475
Reputation: 443
I have faced this problem before, each module loads its own jQuery and conflicts each other.
The solution i have implemented is installing a plugin that prevents the modules from loading jQuery.js and loads only one. Try one of these, maybe it requires little tweaks to fully work:
Upvotes: 2
Reputation: 2012
as sushil bharwani said:
you should add <script type="text/javascript">jQuery = jQuery.noConflict();</script>
into your header, right after you include jquery.min.js
Also make sure you replace all '$' with 'jQuery' in your JS code.
Upvotes: 0
Reputation: 1
(function($){
// code here, you could even use $ here as you like
})(jQuery);
Upvotes: 0
Reputation: 30187
$jQ = jQuery.noConflict();
$jQ("document").ready(function(){
// all the Code for Module X
});
Upvotes: 1