문제

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

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top