Giter Site home page Giter Site logo

Comments (1)

newdesignideas avatar newdesignideas commented on September 27, 2024

Hi Graham, I have done so at PARiM Workforce Software website.

I added an <i class="parim-menu-caret-two"></i> inside the first level link with sub-menu items (you can do the same thing with ::before or ::after pseudo-elements as well):

<li class="megamenu-top-nav-item parim-menu-industries">
					            	<a href="https://parim.co/proven-workforce-software" class="parim-menu-caret open" title="Solutions By Industry" id="megamenu-1540188573104-3" aria-controls="megamenu-1540188573104-4" aria-expanded="true"><i class="parim-menu-caret-two"></i>Industries</a>...

As for CSS - I had two classes - in the normal state the arrow points downwards and in the open state the arrow flicks upwards like this:

.parim-menu-caret-two {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #318FCE;
    position: absolute;
    top: 17px;
    left: 3px;
}

.open .parim-menu-caret-two {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 0px solid transparent;
    border-bottom: 5px solid #318FCE;
    position: absolute;
    top: 17px;
    left: 3px;
    transition: border ease-out 0.05s;
}

You also need to set position:relative; for the first level menu items so the absolute positioning of the caret/arrow works. Inspect the code of our site to see all of the CSS.

from accessible-mega-menu.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.