jquery toggleClass can't get to work -
I am trying to get jquery .toggleClass is not working to work with "this" Can anyone point me in the right direction immediately? Thank you
Actually, I would like to convert non-active Active Act to Class for my blank example.
#contenttab {float: left; Status: Relative; Padding: 10px 15px 10px 15px; ; Width: 350px; Color: # F1F1F1; Font-size: 18px; Boundary-radius: 5px; Transition: .2s ease-in-out; Margins: 10px; Text align: center; Letter-spacing: 3px} .Notactive {background: # 545b60; Infection: .2s low-in-out;} .Notactive: hover {background: # 9adb24; Transition: .2s ease-in-out;} Active {background: # 9adb24! Important} What am I doing wrong?
Thanks in advance.
Jquery was not included in your JS Bellad.
UPDATED
Your HTML has been fixed to remove duplicate IDs, they are unique. And removed your function calls.
& lt; div id = "content_controller" & gt; & Lt; div id = "contenttab1" class = "idle" & gt; Test information & lt; / Div & gt; & Lt; Div id = "contenttab2" class = "idle" & gt; Test template & lt; / Div & gt; & Lt; Div id = "contenttab3" class = "idle" & gt; Test Questions & lt; / Div & gt;
Status: Relative; Padding: 10px 15px 10px 15px; Width: 350px; Color: # F1F1F1; Font-size: 18px; Boundary-radius: 5px; Transition: .2s ease-in-out; Margins: 10px; Text align: center; Letter-spacing: 3px} .Notactive {background: # 545b60; Transition: .2s ease-in-out; } .Note: Hover {background: # 9adb24; Transition: .2s ease-in-out; }. Active {background: # 9adb24! Important}
Added jquery, document.ready, and function calls.
$ (document) .ready (function () ($ ('. Inactive'). Click (function () {$ (this) .toggleClass ("active");}) ;});
Comments
Post a Comment