Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • ce2f Friend
    #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
    Christian

    I found : Include jQuery after Other Libraries and use jQuery.noConflict(); with jQuery like variable

    thuanlq Friend
    #380011

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

    ce2f Friend
    #472528

    thank you because i need you solution

    christian

    Ninja Lead Moderator
    #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

Viewing 4 posts - 1 through 4 (of 4 total)

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