1

How can I remove hover from categories menu in Magento 1.9 RWD? I want only clickable categories.I found solutions for previous versions modifying the menu.js but it's not working with the 1.9 RWD.

2 Answers 2

1

So if I understand you want only category and not the slide menu with all subcategory? If yes, you need to go

/app/design/frontend/yourtheme/yourtemplate/template/page/html/topmenu

You will see the function of the menu and you can just add your menu here and erase the original menu. It is very easy. If you need more info, how to do, let me know.

5
  • I want the same menu with all subcategory, but i want to replace the hover with onclick.
    – Zsolt
    Commented Apr 3, 2016 at 17:30
  • I'm not sur but I think is a JS function, because on scss file _header-nav.scss we do not see any function to activate the sub-menu. An answer have been done here: magento.stackexchange.com/questions/33917/…
    – westh
    Commented Apr 3, 2016 at 18:10
  • I need it for the new magento 1.9 rwd theme, that is totally different from this.
    – Zsolt
    Commented Apr 3, 2016 at 20:33
  • It is a JQuery function as per answer here: stackoverflow.com/questions/18786546/…
    – westh
    Commented Apr 7, 2016 at 19:39
  • Another option with css only: koen.kivits.com/articles/pure-css-menu
    – westh
    Commented Apr 7, 2016 at 19:44
0

You can manage with custom script also.Please check bellow script.

Note : Please change class based on your structure.

First, remove hover effect using this script.

jQuery('.nav-container ul li.parent a').on('mouseover', function(event){
    event.stopImmediatePropagation();
});

Now Manage click event for the open menu, on first click menu open and second click to redirect on the category page.

jQuery('.nav-container ul li.level0 a').click(function(e){
jQuery('.nav-container ul li.level0.parent a').not(this).removeClass('over');
jQuery(this).toggleClass('over');

if(jQuery(this).parent().children('ul').length > 0){
    if(jQuery(this).hasClass('over')){
        jQuery(this).parent().children('ul').css('display','block');
    }else{
        jQuery(this).parent().children('ul').css('display','none');
        window.location.href = jQuery(this).attr('href');    
    }

    e.preventDefault(); 
}

});

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.