html - How to deactivate a class using jquery -


i working on new header website containing 2 seperate dropdown <nav> elements, 1 of hamburger menu turns x when clicked upon, toggling class.

through jquery made when 1 dropdown menu activated, other 1 hidden (if active beforehand).

the problem can't seem figure out how disable class makes hamburger menu x. take @ jsfiddle see it.

(try clicking on 3 bars once, , thereafter on grey button twice see it)

the jquery toggles class can seen on line 27.

-edit: .class toggled can found on line 110 in css.

when clicking upon #prod-toggle should deactivated, have tried using removeclass(), can't targeting right. can tell me how done?

use :

  $("#element id").removeclass(); 

calling removeclass no parameters remove of item's classes.

you can use (but not recommended, correct way 1 above):

      $("#element id").removeattr('class');       $("#element id").attr('class', '');       $('#element id')[0].classname = ''; 

if didn't want use jquery can use java script:

    document.getelementbyid('item').classname = ''; 

Comments

Popular posts from this blog

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -

minify - Minimizing css files -