javascript - How do I "undo" "return false;" for following links? -


I know that before this question has been asked, but I still can not work it

There is a nested list that is used as an index / navigation. With the link at the fourth level, it is 4 levels deep toggled using high level jQuery. To make JavaScript work, I have to use "return false"; But then the links do not work.

How do I work again on the fourth level, i.e. "return true";

Thanks in advance!

HTML:

  & lt; Ul class = "nav" & gt; & Lt; Li & gt; Navi 1 & lt; Ul & gt; & Lt; Li & gt; NAV 1.1 & lt; Ul & gt; & Lt; Li & gt; NAV 1.1.1 & lt; Ul & gt; & Lt; Li & gt; & Lt; A href = "http://google.com" & gt; Google & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "http://amazon.com" & gt; Amazon & lt; / A & gt; & Lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Li & gt; & Lt; / Ul & gt;  

Javascript:

  $ (document) .ready (function () {$ ("li ul"). Hide (); $ ("li "). (Function () {// If the li-element has the class" active "($ (this) .hasClass (" active ")) {//" element "from li-element $ (" this " Remove "Active" from "Remove" ("ul") .removeClass ("active"); // Remove the "active" class from $ (this) element ("ul") .Fund ('li'). RemoveClass ("Active"); // nested ul elements $ (this). Hide ("ul") .Find ("ul"). SlideUp ("sharp"); else {// If there is no class in Li-element Is "active" // adjacent li-element Remove the "active" category from $ (this). ("Ul"). Sybing ('li'). Removeclass ("active"); $ (this) .has ("ul"). ('Li'). ('Li'). Remove clcl ("active"); // to hide nested ul elements from adjacent li-element $ (this). ("Ul") .Sahabandi ('li'). ("Ul") Add SlideUp ("sharp"); // "active" class to li-element $ (this). AddClass ("active"); // show nested ul-element $ (this). ("Ul"). Children ("ul"). Slide down ("sharp");} description is false;}); // This does not work :-( $ (" Nav & gt; Li & gt; Ul> gt> UL & gt; Li & gt; Ul & gt; Li & gt; One.). Click (function () {true};});});  

You have to stop the incident from fluttering. this is easy.

$ ("a"). Click (function (e) {e.stopPropagation ();}); In place of

:

  // This does not work :-( $ (". Nav> 
    • Li> gt; li & gt; ul & gt; li & gt; a.) Click (function () {return true;});

  • Comments

    Popular posts from this blog

    Member with no value in F# -

    java - Joda Time Interval Not returning what I expect -

    c# - Showing a SelectedItem's Property -