1

I have jquery ui dialog box, and I want to Animate multiple dialog boxes on single click. But it animate only inner boxes div inside the complete dialog box.anyone let me know how to do this ? I've done this: Fiddle DEMO

//Script

     $("#animate").click(function() {      

     $('#dialog').animate({
         left: "50px",
            });
     $('#dialog2').animate({
         top: "100px",
            });
 });
4

1 回答 1

2

@Joe 几乎拥有它,但我认为ui-dialog当您实际上有两个不同的动画时,选择器将为两个对话框设置动画。尝试这个:

$('#dialog').parents(".ui-dialog").animate({
             left: "50px",
                });
$('#dialog2').parents(".ui-dialog").animate({
             top: "100px",
                });

     });

这使用.parents()选择器方法来移动适当的对话框。

这里的工作示例:http: //jsfiddle.net/wKcDP/44/

于 2013-10-15T12:42:54.760 回答