Reputation: 26989
Below is the link for the code demo
There are 2 questions
<div>This div is not visible in the output</div>
)Thanks in advance.
Upvotes: 0
Views: 115
Reputation: 2805
Well as Tugkan said all the links are affected by $('.accordion a').click(function(){
that's why it is behaving strange and as far as the division is concerned the property display none is applied to it see in the inspect element.
Do something like this to make division appear :
style="display:block;"
Upvotes: 0
Reputation: 92853
Write like this:
$('.accordion > li > a').click(function(){
$(this).next().slideToggle("fast");
$(this).closest('li').toggleClass('active');
});
Define class name to the DIV instead of .accordion div{display:none}
. Write like this:
.accordion .extended{display:none;}
Check this http://jsfiddle.net/zkZN6/2/
Upvotes: 1
Reputation: 183
the reason is that you defined $('.accordion a').click(function(){
in your javascript which affects all tags under the class name called "accordion". you need to define another classname just specific for the "accr1,accr2,accr3...etc" and define another javascript for them.
Upvotes: 0