Joomla

Joomla

Monday, 05 June 2017 07:23

How to Add JQuery In Joomla

Including Jquery in your joomla 3 to load Joomla Calender

Resolving conflict with JQuery when including jquery library directly.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script> $(document).ready(function(){ $(".advance").click(function(){ $("div#advanceoption").slideToggle(); }); }); </script>

The method above failed to display Joomla Calender popup but toogle slider works properly .

 

Solution

With this method below both joomla calender pop up and toogle slider works perfectly

<?php
$doc = JFactory::getDocument(); JHtml::_('jquery.framework'); $doc->addScriptDeclaration(' jQuery(document).ready(function () { jQuery(".advance").click(function(){ jQuery("div#advanceoption").slideToggle(); }); }); ');
?>