Pergunta

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

Foi útil?

Solução

.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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top