Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Design Dropdown stay open after click?

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #268398
    Xiija
    Participant

    Here is the pen, it’s kind of a screensaver …
    https://codepen.io/Xiija/pen/vRXJgx

    I’d like to click the “Options” dropdown, and be able to click the
    “colors” item, and have it change colors, but not close so that
    users won’t be forced to reclick “options” every time?

    Or should i just put buttons all over the nav bar ? :P

    #268399
    Shikkediel
    Participant

    Just add this to the bottom of the script:

    document.getElementById("myDropdown").addEventListener("click", function(e) {
    
      e.stopPropagation();
    });
    
    #268400
    Xiija
    Participant

    TY :) works like a charm!
    I forked it to test, but the “reload” button was ganked by that,
    and i couldn’t figure how to fix it, so i just took it out of the div :P

    #268711
    [email protected]
    Participant

    Hello i am new here and i am working withBMI Calculator
    BMR Calculator
    CALORIE Calculator

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Design’ is closed to new topics and replies.