Pergunta

Check this demo first

DEMO: http://fiddle.jshell.net/badjohnny/KxdPm/7/show/light/

when I click the "cart" button, there's a container slide down, but the issue is that the scroll bar doesn't work, when I click the cart button again, the scroll bar is worked fine.

I used nicescroll plugin for the scrollbar, the height of slide down container is unfixed, I hope when the height of slide down container is higher than the height of window, the scroll bar will be displayed.

Not sure why it's just worked when I click towice, and how to fix it?

You can view my CSS, js, HTML code as below, the best way to debug is save the [demo][3] to local computer.

Resource: http://jsfiddle.net/badjohnny/KxdPm/7/

Thanks in advance!

Foi útil?

Solução

Working Fiddle --> http://jsfiddle.net/mohammadAdil/KxdPm/11/show/

Their are some changes in this line (used callback function)

topBox.css('height', 'auto').slideDown('slow', function () {
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top