Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function ($) {
- $(document).ready(function () {
- var activeElement = $('#cssmenu').find('.active');
- activeElement.parentsUntil(".section").show();
- $('.section > a').click(function () {
- $('#cssmenu li').removeClass('active');
- $(this).closest('li').addClass('active');
- var checkElement = $(this).next();
- if ((checkElement.is('.group-list')) && (checkElement.is(':visible'))) {
- $(this).closest('li').removeClass('active');
- checkElement.slideUp('normal');
- }
- if ((checkElement.is('.group-list')) && (!checkElement.is(':visible'))) {
- $('.group-list:visible').slideUp('normal');
- $('.category-list:visible').slideUp('normal');
- checkElement.slideDown('normal');
- }
- if ($(this).closest('li').find('ul').children().length == 0) {
- return true;
- } else {
- return false;
- }
- });
- $('.group > a').click(function (e) {
- $('#cssmenu li').removeClass('active');
- $(this).closest('li').addClass('active');
- var checkElement = $(this).next();
- if ((checkElement.is('.category-list')) && (checkElement.is(':visible'))) {
- $(this).closest('li').removeClass('active');
- checkElement.slideUp('normal');
- }
- if ((checkElement.is('.category-list')) && (!checkElement.is(':visible'))) {
- $('.category-list:visible').slideUp('normal');
- checkElement.slideDown('normal');
- }
- if ($(this).closest('li').find('ul').children().length == 0) {
- return true;
- } else {
- return false;
- }
- window.location.href = $(this).attr('href');
- });
- $('.category > a').click(function () {
- $('#cssmenu li').removeClass('active');
- $(this).closest('li').addClass('active');
- var checkElement = $(this).next();
- if ((checkElement.is('.category-list')) && (checkElement.is(':visible'))) {
- $(this).closest('li').removeClass('active');
- }
- if ($(this).closest('li').find('ul').children().length == 0) {
- return true;
- } else {
- return false;
- }
- window.location.href = $(this).attr('href');
- });
- });
- })(jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement