In IE8 the toggle kinda works but it overlays the content below. It works fine in all the other browsers. I've been trying for the past 2 hours to fix this but no luck...
jquery:
$(document).ready(function() {
$('.toggle').hide();
$('.expand-all').click(function(){
// switch visibility
$(this).data('is_visible', !$(this).data('is_visible'));
// change the link depending on whether the element is shown or hidden
$(this).html( (!$(this).data('is_visible')) ? 'Expand all' : 'Hide');
$(this).next().toggle();
return false;
});
});
html:
<div id="categories">
<div class="cat">
<h3>Rice</h3>
<ul>
<li><a href="">Rice brand 1</a></li>
<li><a href="">Rice brand 2</a></li>
<li class="expand-all">Expand all</li>
<div class="toggle">
<li><a href="">Rice brand 1</a></li>
<li><a href="">Rice brand 1</a></li>
</div>
</ul>
</div>
<div class="cat">etc</div>
<div class="cat">etc</div>
<div class="cat">etc</div>
</div>