slideToggle on multiple elements causes jumpy animation in FF
When I click on the image, a small panel slides up to display information. Problem is, when I have multiple sliders on the same page, the animation gets very jumpy in Firefox, but seems fine in all other browsers (haven't tested in IE).
I'm using the following code:
- $(document).ready(function(){
- $('.image').click(function() {
- var slide = $(this).next('.slider');
- $(slide).slideToggle();
- });
- $('.slider').click(function() {
- $(this).slideToggle();
- });
- });
- .slideBox { height: 350px; width: 350px; text-align: center; position: relative; cursor: pointer; float: left; margin: 30px; }
- .image { height: 350px; width: 350px; }
- .slider { position: absolute; bottom: 0; height: 175px; width: 350px; background: url('1pxblack.png'); display: none;}
- .sliderContent{color: #fff; padding: 20px; width: 350px;}
- <div class="slideBox">
- <div class="image"><img src="theimageurl" height="350" width="350"/></div>
- <div class="slider">
- <div class="sliderContent">
- <div class="someText">Some text. Blah Blah Blah.</div>
- </div>
- </div>
- </div>