1

Can anyone advise on an accordion for the left nav on the category pages? Is there a possibility to do this purely using CSS? Or do I need jquery?

4
  • you can't get the onclick event by css, you need javascript to do this. Commented Sep 26, 2015 at 18:02
  • you are using cusom rwd theme or else
    – Magento 2
    Commented Sep 26, 2015 at 18:04
  • Correct I'm using a custom RWD theme... Commented Sep 26, 2015 at 20:28
  • 1
    @MeenakshiSundaram, this is not true at all and there are very many ways of building a fully functional accordion menu without jQuery (or any script) at all. Commented Sep 28, 2015 at 1:33

1 Answer 1

3

You can accomplish this with any combination of Pure CSS alone, CSS + jQuery/Javascript, jQuery/Javascript (although this would be relatively pointless, considering you'd still need the CSS to style the way the menu looks).

Here are a few examples of Pure CSS accordion menus:

And a few examples of jQuery + CSS accordion:

While you can do more with jQuery, it's preferable not to use it if you have the luxury. In this case, assuming the mention CSS accordion menus fulfil your requirements, why should you burden your visitors and their browsers with the unnecessary script?

Note: The only instance where jQuery might be preferable is if you intend on supporting pre-IE9 browsers and some modern CSS features are not fully supported.

0

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.