Sometimes, we face certain jquery conflicts in Joomla. These can be avoided by using jQuery instead of $ in your code.
For example, instead of:
$(function() {
$( "#tabs" ).tabs();
});
Use this:
jQuery(function() {
jQuery( "#tabs" ).tabs();
});
And in your template index (or head includes script file), add a js file (noconflict.js) with just this content:
jQuery.noConflict();
For example:
$this->addScript($this->baseurl."/templates/".$this->template."/js/jquery-1.7.1.js");
$this->addScript($this->baseurl."/templates/".$this->template."/js/noconflict.js");
For example, instead of:
$(function() {
$( "#tabs" ).tabs();
});
Use this:
jQuery(function() {
jQuery( "#tabs" ).tabs();
});
And in your template index (or head includes script file), add a js file (noconflict.js) with just this content:
jQuery.noConflict();
For example:
$this->addScript($this->baseurl."/templates/".$this->template."/js/jquery-1.7.1.js");
$this->addScript($this->baseurl."/templates/".$this->template."/js/noconflict.js");
Comments
Post a Comment