Tuesday, 15 February 2011

javascript - How hide/visible element in accordion -


I want that when the Empodian element is visible duration and IMG element and when it does not display them Indeed, the user clicks on an element to show it, IMG and adds it and when the user hides the slide toggle duration and IMG.

Enter image details here

  $ ("# accordion> li> div") (function () {if (false == $ (this) is .next (). (': View')) {$ ('# Acesser ul') SlideUp (300);} $ (this) .next () SlideToggle (300);}); $ ('# Asiriyuan ul: eq (0)'). Show ();  
  & lt; Script src = "https://ajax.googleapis.com/ajax/libs/JQuery/1.1.1/jquery.min.js" & gt; & Lt; / Script & gt; & Lt; Ul id = "accordion" & gt; & Lt; Li & gt; & Lt; Div & gt; Game & lt; Img src = '' width = '25 'height =' 25 '& gt; & Lt; Br> & Lt; Period & gt; # 20 to & lt; / Span & gt; & Lt; / Div & gt; & Lt; Ul & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Golf & lt; / A & gt; & Lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; Div & gt; Technology & lt; Img src = '' width = '25 'height =' 25 '& gt; & Lt; Br> & Lt; Period & gt; # 20 to & lt; / Span & gt; & Lt; / Div & gt; & Lt; Ul & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; IPhone & lt; / A & gt; & Lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Li & gt; & Lt; / Ul & gt;  

Can I explain Was that you were looking for something like this

  #accordion {list-style: none; Padding: 0 0 0 0; Width: 170px; } #accordion div {display: block; Background color: # FF9927; font-weight: bold; Margin: 1px; Cursor: indicator; Padding: 5 5 5 px; } #accordion ul {list-style: none; Padding: 0 0 0 0; } #accordion ul {display: none; } #accordion ul li {font-weight: normal; Cursor: auto; Padding: 0 0 7px; } #accordion a {text-decoration: none; } #accordion & gt; Le & gt; Div & gt; IMG {display: none; } $ ("# Accordion> gt; li & gt; div"). Click (function () {if (false == $ (this) .next (). (': Visible')) {$ (this). ('IMG'). Show (); $ ('# Ul ') .SlideUp (300);} and {$ (this) .Kids (' IMG '). Hide ();} $ (this) .next () .slideToggle (300);}); $ ('# Aspirion ul: eq (0)'). Show (); $ ('# Accordion & gt; li: First-Child & gt; div & gt; img'). Show (); & Lt; Ul id = "accordion" & gt; & Lt; Li & gt; & Lt; Div & gt; Game & lt; Img src = '' width = '25 'height =' 25 '& gt; & Lt; Br> & Lt; Period & gt; # 20 to & lt; / Span & gt; & Lt; / Div & gt; & Lt; Ul & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Golf & lt; / A & gt; & Lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; Div & gt; Technology & lt; Img src = '' width = '25 'height =' 25 '& gt; & Lt; Br> & Lt; Period & gt; # 20 to & lt; / Span & gt; & Lt; / Div & gt; & Lt; Ul & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; IPhone & lt; / A & gt; & Lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Li & gt; & Lt; / Ul & gt;  

No comments:

Post a Comment