Javascript DropDown Menu Addin For AutoNav Custom Template

Permalink
Hello, I am new to Concrete5 and have been customizing the Simple White template as a test. I wrote this small js add-in file to go in root of a theme directory. Add this line to <yourtheme>/elements/header.php file:
<script type="text/javascript" src="<?php echo $this->getThemePath() ?>/nav_dropdown_addin.js"></script>


This code should work without changing any of the css. But you have to be sure you did the custom template AutoNav "fix" to make Sub Menu items appear under the Header Menu items. The custom template AutoNav fix has been posted in these forums a few times.

I have only tested this a bit with the custom nav template [Header Menu] in the Simple White theme. It only works to one li menu level down. I may work on it some time in the future for more levels of menus.

Forgive my coding, sometimes I am not to swift with my naming conventions and commenting.

And please, everyone feel free to improve it.

1 Attachment