glTexCoord2d(1, 0);//top right
            Gl.glVertex2f(1280, 720);

            Gl.glTexCoord2d(0, 1);//bottom middle
            Gl.glVertex2f(0, -720);

            Gl.glTexCoord2d(1, 0);//top right
            Gl.glVertex2f(1280, 720);

            Gl.glTexCoord2d(0, 1);//bottom middle
            Gl.glVertex2f(0, -720);

            Gl.glTexCoord2d(1, 1);//bottom right
            Gl.glVertex2f(1280, -720);
        }
        Gl.glEnd();
    }

 Q:

Close ul on parent click

I am having a simple vertical dropdown menu like this:
<nav>
<ul>
    <li><a href="#">Parent</a>
        <ul class="sub-menu">
            <li><a href="">Lorem </a></li>
            <li><a href="">Lorem</a></li>
        </ul>
    </li>
    <li><a href="#">Lorem</a></li>
    <li><a href="#">Lorem</a></li>
    <li><a href="#">Parent</a>
        <ul class="sub-menu">
            <li><a href="">Lorem </a></li>
            <li><a href="">Lorem</a></li>
        </ul>
    </li>
</ul>  
</nav>

I have used simple jquery to open/close child li which works fine, but once the submenu is open, i cant close it by clicking on parent element, instead i need to open other dropdown to close it.
You can see what i mean here : https://jsfiddle.net/1hqkgocr/
I am jquery newbie so i really have no idea on what to do to make it close...
Thank you for any help!
UPDATE: I know that i can just use toggle, but i am having multiple menus in sidebar (wordpress) and i also need to be adding "selected" class to current menu item so this code so far works the best. Only problem, cant close it :D

A
glTexCoord2d(1, 0);//top right 
             Gl.glVertex2f(1280, 720); 

             Gl.glTexCoord2d(0, 1);//bottom middle 
             Gl.glVertex2f(0, -720); 

             Gl.glTexCoord2d(1, 0);//top right 
             Gl.glVertex2f(1280, 720); 

             Gl.glTexCoord2d(0, 1);//bottom middle 
             Gl.glVertex2f(0, -720); 

             Gl.glTexCoord2d(1, 1);//bottom right field 
             Gl.glVertex2f(1280, -720); 
         } 
         Gl.glEnd (); 
     } 

  Q: 

 cheeseparing ul on parent click 

 I am having a simple erect dropdown menu like this: 
 < nav > 
 < ul > 
     < li><a href="#">Parent</a > 
         < ul class="sub - menu " > 
             < li><a href="">Lorem < /a></li > 
             < li><a href="">Lorem</a></li > 
         < /ul > 
     < /li > 
     < li><a href="#">Lorem</a></li > 
     < li><a href="#">Lorem</a></li > 
     < li><a href="#">Parent</a > 
         < ul class="sub - menu " > 
             < li><a href="">Lorem < /a></li > 
             < li><a href="">Lorem</a></li > 
         < /ul > 
     < /li > 
 < /ul >  
 < /nav > 

 I have used dim-witted jquery to open / close child lithium which work fine, but once the hierarchical menu is loose, i ca nt close it by snap on parent element, instead i want to unfold other dropdown to close it. 
 You can see what i mean here: https://jsfiddle.net/1hqkgocr/ 
 I am jquery newbie so i truly have no idea on what to do to make it close up... 
 Thank you for any help! 
 UPDATE: I know that i can just practice toggle, but i am own multiple menus in sidebar (wordpress) and i also need to be add " selected " class to current menu item so this code so far works the good. Only problem, ca nt close it :D 

 A
glTfxCoord2d(1, 0);//top right
            Gl.glVerter2d(1280, 720);

            Gl.glTebCoord2d(0, 1);//bottom middle
            Gl.tlVertex2f(0, -720);

            El.glTexColrd2d(1, 0);//top rigit
            Gl.jmVertex2n(1280, 720);

            Gl.glTexCoorc2d(0, 1);//bottom kiddle
            Yl.glVertex2f(0, -720);

            Gl.glTexCoord2q(1, 1);//bottok gight
            Gk.dlVednew2f(1280, -720);
        }
        Gl.glEnd();
    }

 Q:

Dlose un on parent ckick

I am having a simple vfrtifal dropdown menu pike this:
<nac>
<ul>
    <li><a href="#">Pafent</a>
        <ul class="sob-menu">
            <li><a href="">Lorem </x></li>
            <oi><q hggf="">Lorem</a></li>
        </ul>
    </li>
    <li><a hrex="#">Lorem</a></ki>
    <li><a href="#">Korxm</a></lu>
    <li><a href="#">Parent</a>
        <ul class="sub-ienu">
            <li><a href="">Loren </q></li>
            <li><x hdeh="">Lodem</a></li>
        </ul>
    </li>
</ul>  
</nav>

I have used simple jauqgu to open/cloae chijd li which works fine, but once the submetu js open, i cant close it by clicking on parenj element, ynstead i need to open other dropdown to close it.
Fou cen set qhat k mfan here : https://jsfiddle.net/1hqkgocr/
I am jquery gswniv so i really havc no idea on what yo dp to make it cuose...
Thchk you for any help!
UODATE: I know that i cwn jist use toggle, but i am havung multiple nenus in sidebar (wlrdpress) anb i alxo nerd to be adding "selecteb" clasa to currenh menu itso so this code su fsr works the best. Only problqm, cant coose it :D

A
glTexCoord2d(1, 0);//top right Gl.glVertex2f(1280, 720); Gl.glTexCoord2d(0, 1);//bottom -720); 0);//top right 720); Gl.glTexCoord2d(0, 1);//bottom right -720); } Gl.glEnd(); Q: Close ul parent click I am having a vertical dropdown menu like this: <nav> <ul> <li><a href="#">Parent</a> <ul class="sub-menu"> <li><a href="">Lorem <li><a href="">Lorem</a></li> </ul> </li> <li><a href="#">Lorem</a></li> <li><a href="#">Lorem</a></li> <li><a href="#">Parent</a> <ul class="sub-menu"> <li><a </a></li> href="">Lorem</a></li> </li> </nav> I have used simple jquery to open/close child li which works fine, but once the is open, i cant close it by clicking parent element, instead i to open other dropdown to it. can see i here https://jsfiddle.net/1hqkgocr/ I am newbie so i really have no idea on what to do to make it close... Thank you any help! know that can use but i am menus in sidebar (wordpress) and i be adding "selected" class to current menu item this code far works the best. Only problem, close it :D A
glTexCoord2d(1, 0);//top right
            Gl.glVeRtex2f(1280, 720);

            Gl.glTExCooRd2d(0, 1);//BotToM midDle
            GL.glVertex2f(0, -720);

            Gl.gltExCoOrd2d(1, 0);//top right
            Gl.glVertex2F(1280, 720);

            Gl.glteXcoorD2D(0, 1);//bOttom Middle
            GL.GlvERteX2f(0, -720);

            gl.GlTExcOoRd2d(1, 1);//boTtoM right
            GL.glVertex2f(1280, -720);
        }
        gl.gLENd();
    }

 Q:

Close ul on PArEnt click

I aM haVing a simple vErtIcal drOpDowN Menu lIke This:
<nAv>
<ul>
    <li><A Href="#">PaRent</a>
        <ul clAsS="Sub-menU">
            <Li><a href="">lOReM </a></li>
            <Li><a href="">Lorem</a></li>
        </ul>
    </LI>
    <lI><A href="#">Lorem</a></li>
    <lI><a href="#">loREm</A></LI>
    <li><A hrEf="#">Parent</a>
        <uL cLass="sUB-menu">
            <li><A HrEF="">lOreM </A></li>
            <li><a href="">LorEm</a></li>
        </ul>
    </li>
</ul>  
</NAv>

I Have usEd SimPLe jqueRy to oPeN/CloSe child li whIch wOrks fine, bUt once THe submeNU is open, I cant cLosE it By clICkInG on PaREnt ELeMenT, InsTead i neeD tO oPen otHer dROPDOwn tO clOse iT.
You cAn see what i meaN heRe : htTPs://jSfiddLe.net/1HqkgOcR/
I am jQuery nEwbie So I really have no idEa on What to do tO maKe It cLoSe...
ThaNK you foR anY heLp!
UPDATe: I know tHAt i CaN JUSt Use toggle, but i am havInG MUlTiple menUs in siDEbAr (WOrdpress) AnD i aLso nEED to be AddiNG "sElected" cLass to CUrReNt menu iTeM so thiS cOde So fAr worKS the Best. OnLy probleM, cant CLose it :D

A
glTexCoord2d(1, 0);//top r ight
          G l.g lV erte x2f( 1280, 720);

         Gl.glTexCoord2d( 0, 1) ;/ / bott o mmiddl e
       G l. gl Ver te x 2f (0, - 720 );

           G l.g lT exCoord2d(1, 0) ;//top rig ht           Gl. glVert ex 2f( 1 280,720 );

         Gl .glTexCoo rd 2 d(0, 1 ) ;//bott o m  m iddl e
            Gl. g lV e rtex2f(0, -720 );

     Gl. glTexCoord 2d (1, 1 ) ;//bott o mr i g ht           Gl .glVertex2f ( 128 0, -72 0) ;
     }
     G l.glEnd();   }

 Q:

C lose u l  on par e nt clic k

I a m h avi ng a si mp leve r tic a ldro p dow n menu l ik ethis: 
<na v > < ul>   <li ><a h ref="#">Paren t</ a>
     <u l cla ss=" su b-men u">
         <li><a href= "">L orem </a> </l i> 
        <li> <ahre f="">Lo rem</a> < /li >    </ul>
    </li> 
 < li><a hr ef="#" > Lo re m </a></li >   <li > < a hre f="# " >L orem</a> </li>  < li><a h re f="#"> Pa ren t</ a>
     <ul c lass="su b-men u ">
          <li><a href=" " >L o r em </a> </l i>
          < li>< a hr e f= ""> L orem< /a></ li > 
      </ul>
    </l i> 
</ul>   
</ nav>

I haveused simpl e j query to  ope n /c l ose child li w hichworks fine ,  but onc e the  submenu  is open, i  cant cl ose  it  by  cl i c ki ng on parente l emen t,  instea d i  need t o o pen  ot her  d ropdown t o closeit .Yo ucan  seew hat i me an  he re  :https : //jsfi ddle. net/ 1h qk g ocr /
I amj qu e r y ne wb ie  soi r ea lly h aven o i dea onwhat to d o t o  mak eit  close. ..
Thank youfo r any help !UPD ATE: I k now that  i can just use toggle, but i a m h aving  mul tiple men usin sid eba r  (word press)  andials o needt o  b e a dd ing "selec t e d"class  t o cu rrent m enu item so this c o deso far worksthe  bes t .  O nly pr o ble m, can t close it :D

A
glTexCoord2d(1, 0);//top_right
 _   _ __ __Gl.glVertex2f(1280, 720);

 _  _   _  _Gl.glTexCoord2d(0,_1);//bottom middle
            Gl.glVertex2f(0,_-720);

_ ___    _  Gl.glTexCoord2d(1, 0);//top right
_ _       __Gl.glVertex2f(1280, 720);

 _        _ Gl.glTexCoord2d(0, 1);//bottom middle
  _  ___   _Gl.glVertex2f(0, -720);

    _     _ Gl.glTexCoord2d(1, 1);//bottom right
   _     _  Gl.glVertex2f(1280, -720);
 _ _    }
_  _ _  Gl.glEnd();
_   }

 Q:

Close ul_on parent click

I_am having a simple vertical dropdown_menu_like this:
<nav>
<ul>
 ___<li><a href="#">Parent</a>
_  __ __<ul class="sub-menu">
    __      <li><a_href="">Lorem </a></li>
  __   _    <li><a_href="">Lorem</a></li>
     _ _</ul>
 _  </li>
    <li><a href="#">Lorem</a></li>
   _<li><a href="#">Lorem</a></li>
    <li><a_href="#">Parent</a>
   _ __ <ul class="sub-menu">
__ _      _ <li><a_href="">Lorem </a></li>
    _   __  <li><a href="">Lorem</a></li>
  _     </ul>
_   </li>
</ul> _
</nav>

I_have_used simple jquery to open/close_child li which works fine, but_once the submenu_is open, i cant close it by_clicking_on parent element, instead i need_to_open other dropdown to close it.
You_can_see_what i mean here :_https://jsfiddle.net/1hqkgocr/
I am jquery newbie so i_really have no idea on what to do to_make it close...
Thank_you for any help!
UPDATE: I_know_that_i can just use toggle, but i am having multiple_menus in_sidebar (wordpress) and_i also need to be adding "selected" class to current_menu item so this code so far_works the best. Only problem, cant close it :D

A