-
AuthorPosts
-
March 5, 2011 at 12:45 pm #161058
Hello,
I use Ja-tabs for 2 years with Joomla 1.0.15.I wanted to use jquery script but I put link of javascript in the php file but Ja-tabs does not work any more. Can we solve this probleme in order to use Ja-tabs and library jquery ?
i try jQuery.noConflict(); with jQuery like variable ; jquery works but the menu css of ja-tabs don’t work
Thanks
ChristianI found : Include jQuery after Other Libraries and use jQuery.noConflict(); with jQuery like variable
thuanlq Friendthuanlq
- Join date:
- October 2010
- Posts:
- 528
- Downloads:
- 0
- Uploads:
- 29
- Thanks:
- 8
- Thanked:
- 121 times in 99 posts
March 7, 2011 at 7:23 am #380011Hi Christian,
To include jquery and use for ja-tabs, please do as following:
– Open the file “ja_tabs.php” in the folder “plugins/content/”, then define new function “onAfterRender()” of class “plgContentJA_tabs”:
function onAfterRender()
{
// Return if page is not html
global $mainframe;if ( $mainframe->isAdmin() ) { return; }
$_body = JResponse::getBody();
// Base path string
$hs_base = JURI::base().'plugins/content/ja_tabs/';
// Tag array
$headtag = array();
$headtag[] = '<script src="'.$hs_base.'js/jquery-1.3.2.min.js" type="text/javascript" ></script>';
$headtag[] = '<script type="text/javascript" >if (jQuery) jQuery.noConflict();</script>';
$_body = str_replace( '</head>', "t".implode("n", $headtag)."n</head>", $_body );if ( $_body ) {
JResponse::setBody( $_body );
}
return true;
}
Here code will include JQuery after other libraries,
Regards,November 10, 2012 at 6:59 pm #472528thank you because i need you solution
christian
Ninja Lead ModeratorNinja Lead
- Join date:
- November 2014
- Posts:
- 16064
- Downloads:
- 310
- Uploads:
- 2864
- Thanks:
- 341
- Thanked:
- 3854 times in 3563 posts
November 12, 2012 at 8:57 am #472618<em>@ce2f 345680 wrote:</em><blockquote>thank you because i need you solution
christian</blockquote>
Hi christian,What JATab version and Joomla version your site is running?
With JA Tabs on J2.5 you can fix with my solution
<blockquote>Open plugins/system/jatabs/jatabs.php file</blockquote>
find this function: onAfterRender()
from
JResponse::setBody($this->_body);
change to
$headtag[] = '<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js" type="text/javascript" ></script>';
$headtag[] = '<script type="text/javascript" >if (jQuery) jQuery.noConflict();</script>';
$this->_body = str_replace( '</head>', "t".implode("n", $headtag)."n</head>", $this->_body );JResponse::setBody($this->_body);
You can use jQuery on JA Tabs plugin.
Regards
-
AuthorPosts
This topic contains 4 replies, has 3 voices, and was last updated by Ninja Lead 12 years ago.
We moved to new unified forum. Please post all new support queries in our New Forum