javascript - Collpasible menu needs all header needs to be closed on initial loading -


I have a sidebar with an open menu that works fine but all values ​​come in the expansion of initial loading time Are there. I should close it on the load and then toggled it.

Here jquery is used

  // sidebar toggle var liquid = {toggle: function () {var default_hide = {"grid": true}; $ .each (["Pejanev", "Tipsenave", "Usnesnive", "ImageNew"], Function () {var el = $ ("#" + (This == 'Esenon'? ACCE-Block ': This $ ("[+ Id = 'Toggle -" + +' '] "). AddClass (" hidden ");} $ (" [id =' Toggle - "+ + '']") .bund ("Clicks ", Function (e) {if ($ (this) .hasClass ('hidden')) {$ (this) .removeClass ('hidden'). AddClass ('visible'); El S.Lieddown ();} and {$ (This is) .removeClass ('visible'); ADCLASS ('hidden'); LSLEDEE ();} E. Prentent default ();});});}} JQuery (function ($) {if ($ (" [Id ^ = 'Toggle'] ").) Length) {fluid.Toggle ();}});  

Here html

  & lt; span class = "ul-header"> an id = "toggle-pagesnav" href = "#" class = "toggle visible" & gt; Content & lt; / a & gt;  & lt; ul id = "pagesnav"> 
  • A class = "icn_manage_pages" href = "#" & Gt; Manage pages & lt; / a & gt; & lt; / li & gt; & lt; li & gt; & lt; a class = "icn_add_pages" href = "#" & gt; add page & lt ; / A & gt; & lt; / li & gt; & Lt; Li & gt; & Lt; One class = "icn_edit_pages" href = "#" & gt; Edit page & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; One class = "icn_delete_pages" href = "#" & gt; Delete Page & lt; / A & gt; & Lt; / Li & gt; & Lt; / Ul & gt; & Lt ;! - Final Content Navigation - & gt; & Lt ;! - Start Comments Nav - & gt; & Lt; Span class = "ul-header" & gt; An id = "toggle-commentsnav" href = "#" class = "toggle visible" & gt; Comments & lt; / A & gt; & Lt; / Span & gt; & Lt; Ul id = "commentsnav" & gt; & Lt; Li & gt; & Lt; One class = "icn_manage_comments" href = "#" & gt; Manage comments & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; One class = "icn_add_comments" href = "#" & gt; Add comments & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; One class = "icn_edit_comments" href = "#" & gt; Edit annotations & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; One class = "icn_talit_tems" href = "#" & gt; Delete Comments & lt; / A & gt; & Lt; / Li & gt; & Lt; / Ul & gt;
  • The CSS is used here

     . Toggle {display: block; } .l-header one. Visual {background: url ('../img / icons / small / toggle_close.png') No-double scrolling 97% 50%; } .l- Hyder a.hidden {background: url ('../img / icons / small / toggle_open.png') No-double scrolling 97% 50%; }  

    Please help.

    This is the variable to see if any block is hidden or not Var default_hide = {"grid": true}; Change it to

      var default_hide = {"pagesnav"}: True, "commentsnav": True, "userssnav": true, "imagesnav" : True}  

    and it should work.

    Or you can remove it if:

      if (default_hide [this])  

    Comments

    Popular posts from this blog

    windows - Heroku throws SQLITE3 Read only exception -

    lex - Building a lexical Analyzer in Java -

    python - rename keys in a dictionary -