user1958454 user1958454 - 3 months ago 21
jQuery Question

jQuery - Slidetoggle works but not in Firefox

<script>
jQuery(document).ready(function($){
$("#panel").click(function(){

event.preventDefault();
$("#panel_stats").slideToggle("slow");

});
});
</script>


I can confirm that this works in Chrome and Safari but somehow not in Internet Explorer and Firefox. I've already read somewhere that having a inline HTML "display:none" would work but in the end it didn't.

Removing event.preventDefault(); did the trick, thank you all !

Answer
<script>
$(document).ready(function(){
    $("#panel").click(function(){ 
       $("#panel_stats").slideToggle("slow");    
    });
});
</script>

Try removing event.preventDefault(); also define panel to #panel or .panel

DEMO: http://jsfiddle.net/enve/L4nXy/

Comments