javascript - Is possible to have more granular control over jQuery UI Dialog Widget's showhide method? - Stack Overflow

Currently it seems that I can only use effects in their most basic form when using the Dialog widget.

Currently it seems that I can only use effects in their most basic form when using the Dialog widget. For example, the following will use the drop effect for both showing and hiding the dialog box:

$('#dialog').dialog({show:'drop', hide:'drop'});

However, the default for the drop method always drops to the left. What I really want is for it to drop to the right. Something like this:

$('#dialog').dialog({
   show:{effect:'drop', direction:'right'},
   hide:{effect:'drop', direction:'right'}
});

Is this possible?

I'm currently using 1.6rc6. I've also tried it 1.5.3 (stable) without any luck.


After digging into the source a bit, I don't think this is supported in both version 1.5.3 and 1.6rc*. It'll probably require a change to the API before the functionality above can be supported. Steerpike has found a version that probably should be in the mainline. If anyone knows otherwise, do correct me.

Currently it seems that I can only use effects in their most basic form when using the Dialog widget. For example, the following will use the drop effect for both showing and hiding the dialog box:

$('#dialog').dialog({show:'drop', hide:'drop'});

However, the default for the drop method always drops to the left. What I really want is for it to drop to the right. Something like this:

$('#dialog').dialog({
   show:{effect:'drop', direction:'right'},
   hide:{effect:'drop', direction:'right'}
});

Is this possible?

I'm currently using 1.6rc6. I've also tried it 1.5.3 (stable) without any luck.


After digging into the source a bit, I don't think this is supported in both version 1.5.3 and 1.6rc*. It'll probably require a change to the API before the functionality above can be supported. Steerpike has found a version that probably should be in the mainline. If anyone knows otherwise, do correct me.

Share Improve this question edited Feb 27, 2012 at 9:32 newtonapple asked Feb 10, 2009 at 7:20 newtonapplenewtonapple 4,1333 gold badges35 silver badges31 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 2

Actually, you can use any of the jQuery UI effects; e.g. pulsate:

$("#dialog").dialog({ show: "pulsate" });

There are plenty to be found here: http://docs.jquery./UI/Effects/

Note that there is a dependency on effects.core.js.

I tried passing an option (like you did) into 'show', it didn't work. I also tried to make 'show' a function, no luck avail.

What works however is:

$("a").click(function() {
    $("#dialog").hide("drop", { direction: "right" }, 1000);
});

This is currently not Possible with 1.6 and 1.7.1.

You may find this link of dialog box examples useful. In particular the second one from the right. I'm not sure if it's using the standard dialogue plugin, but you should be able to figure it out from the examples they use.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745409523a4626465.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信