javascript - "active" class somehow being removed from ".caret" -
Even if in my mouseover function, it is clearly class active
to when you Double click on the "dropdown" (once to show the menu; to hide once) and when the "dropdown" is empty and the dropdown menu is hidden, make it "graded"
still has its own cursor on "oars", fails to change the caret color (gray turn), which is strange.
The only way to improve this is by & lt; Span & gt;
element and then re-enter it, at that point, it should be done in brown form However, I would like to change it in brown in every circumstance, unless the span element is being placed above and The dropdown is hidden.
The problem still seems to be that the active
class is being removed from anywhere, whenever "dropdown" is clicked twice, but I do not know where that is.
How does anyone have to fix this?
HTML:
& lt; Div class = "navbar navbar-inverse navbar-fixed-top" & gt; & Lt; Div class = "container" & gt; & Lt; Div class = "collapse navbar-collapse navHeaderCollapse" & gt; & Lt; Ul class = "nav navbar-nav navbar-right" & gt; & Lt; Li class = "dropdown" & gt; & Lt; A href = "#" class = "dropdown-toggle" data-toggle = "dropdown"> gt; & Lt; Span & gt; Dropdown & lt; / Span & gt; & Lt; B square = "carat" & gt; & Lt; / B & gt; & Lt; / A & gt; & Lt; Ul class = "dropdown menu" & gt; & Lt; Li & gt; & Lt; A href = "# subtab1" & gt; 1 & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "# subtab2" & gt; 2 & lt; / A & gt; & Lt; / Li & gt; & Lt; / Ul & gt; & Lt ;! - END: "Dropdown-menus" - & gt; & Lt; / Li & gt; & Lt ;! - END: "Dropdown" - & gt; & Lt; / Ul & gt; & Lt ;! - END: "nav navbar-nav navbar-right" - & gt; & Lt; / Div & gt; & Lt ;! - END: "collapse navbar-collapse navHeaderCollapse" - & gt; & Lt; / Div & gt; & Lt ;! - END: "Container" - & gt; & Lt; / Div & gt; & Lt ;! - END: "navbar navbar-inverse navbar-fixed-top" - & gt;
CSS:
Duration {color: #ffffff; } Span.active {color: #bdbcae; } .caret {color: #ffffff; } .caret.active {color: #bdbcae; }
Javascript:
/ * Start: Explains teleport * / var counter = 0; Const. EMPTY_COUNTER = 0, FULL_COUNTER = 2; Var shouldOpen = function () {return counter === FULL_COUNTER; }; Var resetCounter = function () {counter = EMPTY_COUNTER; }; Var incrementCounter = function () {counter ++; }; $ (Document) .on ("click", "span", function (e) {e.preventDefault (); if (counter == 1 & !! ('.downloaddown-menu'). (": (": Visible")} {resetCounter ();} Incremental Quarter (); if (should open) = counter == 1 & amp; $ ('.download-menu'). ($ " Span ") .removeClass (" active "); ResetCir ();} and {$ (".caret") .removeClass ("active");}}); / * Id: Experiments Teleport * / / * Start: Click on Span / Carat / $ ("A.DropDown-Toggle") .Mosedown (function () {if ($ (event.target) .closest ("span") Length is {if ($ ('. Dropdown-menu'). (": Appears") & amp ;! $ (".dropdown") .hasClass ("active")) {$ ("span") .addClass ("active");} if (! $ ('. Dropdown-menu') is (": appears")) {$ (".caret") .addClass ("active");}} And {$ (".caret") .addClass ("active");}}); / * END: Click on SPAN / CARAT * / / * START: Carat on the hotel * / $ (document). Mouseover (function () (if ($ (event.target) .closest ("A.DropDown-Toggle") .length) {if ($ (event.target) .closest ("span") length) {if (! $ ('. Dropdown-menu'). (": Visible")) {$ ("." " ("Active"); addClass ("active");} and {$ (".caret") .removeClass ("active");}} and {$ (".caret") .addClass ("active"); $ ("(" Active ") .removeClass (" active ");}} and {$ (" span ") .removeClass (" active "); $ (" .caret ") .removeClass (" active ");} }); / * END: Care on Hover * /
Comments
Post a Comment