Simple Toggle
$(document).ready(function(){
$("#classes").click(function(){
$("#class_breakdown").slideToggle("slow");
});
});
<a href="javascript:void(null)" id="classes" onclick="click(); return false;">View All Classes »</a>
<div id="class_breakdown">All Stuff Here</div>
IE works Great, however Firefox is expanding the div when clicked, and after it fully expands it collapses and returns to Display:None.
Thoughts?
You are doing to much, you have to remove the
click()in the onclick attribute because you already binding to the click event with jQuery:I added
e.preventDefault()instead ofreturn falsebecause it’s works better cross-browser.