How can I get jquery to execute animations in exact parallel?

前端 未结 7 1943
梦谈多话
梦谈多话 2020-12-09 00:30

I\'m trying to create an accordion widget in jquery similar to jquery\'s accordion plugin, with the difference that I want the handles to appear below their respective conte

7条回答
  •  死守一世寂寞
    2020-12-09 00:36

    I think your problem isn't timing but fractional division of a pixel. If you try this code it looks smooth for handle 1 and 2 but not others in Firefox 3 but still looks jumpy in chrome.

     active
        .animate({ height: "100px" })
        .siblings(".section")
        .animate({ height: "0px" });
    

    Have you thought about making the position of the elements static or absolute? If your only moving the position of two elements you don't have to worry about the other ones jumping. Give me a second and I'll try to make an example.

提交回复
热议问题