jquery - How to add a list inside an awsAccordion list? -
i want create accordion using awsaccordion.js , insert lists inside accordion.
example, have list inside first <li>
:
<div id="accordion1"> <ul> <li> <h1>heading 1</h1> <div> <span> phasellus eget libero elit, sodales felis. morbi ligula tellus, posuere nec interdum ac, blandit et ante. morbi nibh orci, eleifend vitae venenatis non, molestie in magna. </span> <ul> <li>list 1</li> <li>list 2</li> <li>list 3</li> <li>list 4</li> </ul> </div> </li> <li> <h1>heading 2</h1> <div> <span> phasellus eget libero elit, sodales felis. morbi ligula tellus. morbi ligula tellus, posuere nec interdum ac, blandit et ante </span> </div> </li> </ul> </div>
the problem when click on list, example: <li>list 1</li
> accordion closes. (see fiddle: http://jsfiddle.net/8f9yc/ ).
why? how can solve problem?
any appreciated. thank you.
if @ source code here, see problem instruction :
... parent().find('li') ...
what can replace instructions in sources, with
... parent().find('.myli') ...
and use in html code :
<div id="accordion1"> <ul> <li class="myli"> <h1>heading 1</h1> <div> <span> phasellus eget libero elit, sodales felis. morbi ligula tellus, posuere nec interdum ac, blandit et ante. morbi nibh orci, eleifend vitae venenatis non, molestie in magna. </span> <ul> <li>list 1</li> <li>list 2</li> <li>list 3</li> <li>list 4</li> </ul> </div> </li> <li class="myli"> <h1>heading 2</h1> <div> <span> phasellus eget libero elit, sodales felis. morbi ligula tellus. morbi ligula tellus, posuere nec interdum ac, blandit et ante </span> </div> </li> </ul> </div>
that should work !
bye
Comments
Post a Comment