how to use click in this jquery -
jquery.noconflict(); jquery(document).ready(function ($) { var $oe_menu = $('#oe_menu'); var $oe_menu_items = $oe_menu.children('li'); $oe_menu_items.bind('mouseenter', function () { var $this = $(this); $this.addclass('selected'); $this.children('div').css('z-index', '9999').stop(true, true).slidedown(300, function () { $(this).parent().not('.selected').children('div').hide(); }); }).bind('mouseleave', function () { $(this).children('div').hide(); var $this = $(this); $this.removeclass('selected').children('div').css('z-index', '1'); }).bind('click', function () { $(this).children('div').hide(); var $this = $(this); // if (window.mobilecheck()) { $this.removeclass('selected').children('div').css('z-index', '1'); // } }); $oe_menu.bind('mouseenter', function () { var $this = $(this); $this.addclass('hovered'); }).bind('mouseleave', function () { var $this = $(this); $this.removeclass('hovered'); $this.children('div').hide(); }).bind('click', function () { // if (window.mobilecheck()) { var $this = $(this); $this.removeclass('hovered'); $this.children('div').hide(); // } }); if ($('.grid-categories-megamenu').parent().parent()) { $('.grid-categories-megamenu').parent().parent().mouseenter(function () { height1 = $(this).attr('id'); var max_height_title = 0; $.each($('#' + height1 + ' .level1-title'), function (key, e) { if (max_height_title < $(this).height()) { max_height_title = $(this).height(); } }); $('#' + height1 + ' .level1-title').height(max_height_title); var max_height1 = 0; $.each($('#' + height1 + ' .level1-megamenu'), function (key, e) { if (max_height1 < $(this).height()) { max_height1 = $(this).height(); } }); $('#' + height1 + ' .level1-megamenu').height(max_height1); }); } if ($('.list-categories-megamenu').parent().parent()) { $('.list-categories-megamenu').parent().parent().mouseenter(function () { height2 = $(this).attr('id'); var max_height2 = 0; $.each($('#' + height2 + ' .level1-megamenu'), function (key, e) { if (max_height2 < $(this).height()) { max_height2 = $(this).height(); } }); $('#' + height2 + ' .level1-megamenu').height(max_height2); }); } if ($('.group-category').parent().parent().parent()) { $('.group-category').parent().parent().parent().mouseenter(function () { height3 = $(this).attr('id'); var max_height3 = 0; $.each($('#' + height3 + ' .level1-megamenu'), function () { if (max_height3 < $(this).height()) { max_height3 = $(this).height(); } }); $('#' + height3 + ' .level1-megamenu').height(max_height3); }); } if ($('.products-megamenu-grid').parent().parent()) { $('.products-megamenu-grid').parent().parent().mouseenter(function () { height4 = $(this).attr('id'); var max_height_name = 0; $.each($('#' + height4 + ' .product-name'), function (key, e) { if (max_height_name < $(this).height()) { max_height_name = $(this).height(); } }); $('#' + height4 + ' .product-name').height(max_height_name); }); } }); the script above being used control megamenu magento website. in mobile phone view need able click open menu click close it. if possible there away can hide sub-categories plus sign? please adivce.
Comments
Post a Comment