开发者

animating the trigger element of jquery datepicker to be the same width as the datepicker

I have a lin开发者_如何学Gok element that has a datePicker attached. The link is styled to look like a button. I would like to animate the link to become the same width as the datepicker when this is shown.

Somehow the jQuery animate library must know the final width and height of the datepicker in order to animate it. So how do I tap in to that or how do I make the animation run for both the trigger link and the datepicker element?


I found out that something like this works just fine.

$('#target').datepicker('show');
$('#target').animate({'width': $('#target').datepicker('widget').width()}, 500);

Then you just have to find the correct animation type and duration that matches the animation of the datepicker.

I ended up not using this though, so no testing has been done on it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜