Question

http://jsfiddle.net/mickzer/3MbRJ/1/

Above is a fiddle of a set of accordions.

When you click the accordions to open and close them, the transition is very snappy and almost jumpy.

Here is the JQUERY:

$('#accordion .hide').hide();
    $('#accordion .title .anchor').click(function(){

        $(this).parent().next().slideToggle();
        return false;

    });

    $('#accordion .title span:last').click(function () {

        $('#accordion .hide').slideUp();

    });

Why is this and how do I stop it happening.

Thanks

Était-ce utile?

La solution

.hide has min-height: 70px set. Take this out, and your snappiness goes away. The reason this is causing issues is when it goes from display: none to display: block, it immediately has a height of 70px.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top