Line 811: | Line 811: | ||
</div> | </div> | ||
+ | <script type="text/javascript"> | ||
+ | (function (window, document) { | ||
+ | var layout = document.getElementById('layout'), | ||
+ | menu = document.getElementById('menu'), | ||
+ | menuLink = document.getElementById('menuLink'), | ||
+ | content = document.getElementById('content'); | ||
+ | |||
+ | |||
+ | function toggleClass(element, className) { | ||
+ | var classes = element.className.split(/\s+/), | ||
+ | length = classes.length, | ||
+ | i = 0; | ||
+ | |||
+ | for(; i < length; i++) { | ||
+ | if (classes[i] === className) { | ||
+ | classes.splice(i, 1); | ||
+ | break; | ||
+ | } | ||
+ | } | ||
+ | // The className is not found | ||
+ | if (length === classes.length) { | ||
+ | classes.push(className); | ||
+ | } | ||
+ | |||
+ | element.className = classes.join(' '); | ||
+ | } | ||
+ | |||
+ | function toggleAll(e) { | ||
+ | var active = 'active'; | ||
+ | |||
+ | e.preventDefault(); | ||
+ | toggleClass(layout, active); | ||
+ | toggleClass(menu, active); | ||
+ | toggleClass(menuLink, active); | ||
+ | } | ||
+ | |||
+ | menuLink.onclick = function (e) { | ||
+ | toggleAll(e); | ||
+ | }; | ||
+ | content.onclick = function(e) { | ||
+ | if (menu.className.indexOf('active') !== -1) { | ||
+ | toggleAll(e); | ||
+ | } | ||
+ | }; | ||
+ | |||
+ | |||
+ | |||
+ | }(this, this.document)); | ||
+ | </script> | ||
+ | |||
+ | <script type="text/javascript" > | ||
+ | function Show(tagId) { | ||
+ | if (document.getElementById(tagId).style.display=="none") { | ||
+ | document.getElementById(tagId).style.display="block"; | ||
+ | |||
+ | } | ||
+ | else { | ||
+ | document.getElementById(tagId).style.display="none"; | ||
+ | } | ||
+ | } | ||
+ | </script> | ||
</body> | </body> | ||
</html> | </html> |
Revision as of 14:23, 16 October 2017