The raditex-utils.js

This is the raditex-utils.js.

source-highlight -n --input=raditex-utils.js --output=src/raditex-utils.js.html
01: /***********************************************************************
02: *  When the user clicks on the button,
03: * toggle between hiding and showing the dropdown content 
04: ************************************************************************/
05: 
06: 
07: ( function( $ ) {
08: $( document ).ready(function() {
09:     // Cache the elements we'll need
10:     var menu = $('#cssmenu');
11:     var menuList = menu.find('ul:first');
12:     var listItems = menu.find('li').not('#responsive-tab');
13: 
14:     // Create responsive trigger
15:     menuList.prepend('<li id="responsive-tab"><a href="#">Menu</a></li>');
16: 
17:     // Toggle menu visibility
18:     menu.on('click', '#responsive-tab', function(){
19:         listItems.slideToggle('fast');
20:         listItems.addClass('collapsed');
21: });
22: });
23: } )( jQuery );
24: 
25: function myFunction() 
26: {
27:     document.getElementById("myDropdown").classList.toggle("show");
28: }
29: 
30: /**********************************************************************
31: * Close the dropdown menu if the user clicks outside of it
32: ***********************************************************************/
33: window.onclick = function(event) 
34: {
35: 
36:   if (!event.target.matches('.dropbtn')) {
37: 
38:     var dropdowns = document.getElementsByClassName("dropdown-content");
39:     var i;
40:     for (i = 0; i < dropdowns.length; i++) {
41:       var openDropdown = dropdowns[i];
42:       if (openDropdown.classList.contains('show')) {
43:         openDropdown.classList.remove('show');
44:       }
45:     }
46:   }
47: }
48: 
49: /**********************************************************************
50: *
51: ***********************************************************************/
52: