Reputation: 139
I need to add this to joomla I've tried adding it to the template index.php file but it doesn't work any ideas?
<script type="text/javascript">
$(document).ready(function() {
$("nav#menu").mmenu(
{
classes: "mm-light"
});
});
</script>
Upvotes: 0
Views: 2720
Reputation: 19733
You're Joomla site is importing jQueury in noConflict mode, therefore you must either use the jQuery
alias, or pass the $
through the function, like so:
$doc = JFactory::getDocument();
$doc->addScriptDeclaration('
jQuery(document).ready(function($) {
$("nav#menu").mmenu({
classes: "mm-light"
});
});
');
The above code is PHP so you can place it anywhere in your template within PHP tags.
I've also noticed on your site that the responsive menu is now working. Tested in Chrome and Firefox.
Upvotes: 4