对话框缩放效果jquery
是否可以在 jquery 中为对话框重新创建类似缩放的效果,而无需下载灯箱插件?
我想向我的对话框添加动画以模拟在此页面上找到的“缩放”效果 当您单击其中一张图像时。
不需要另一个插件,这可以用开箱即用的 jQuery 来完成吗?希望能够从用户单击的屏幕上的特定点(例如按钮或链接)将对话框(模态)动画化到具有适当内容的更大容器中 - 缩放叠加效果?
非常感谢任何帮助...
编辑:
$(function() {
$("#testdialog").dialog({
autoOpen: false,
minWidth: 425,
minHeight: 300,
position: ['center', 115],
resizable: false,
modal: true
});
$("#opener").click(function () {
$("#testdialog").dialog("open").position();
return false;
});
});
[div id =“testdialog”]此处的一些内容[/ div]
[input type =“button”id =“opener”/]
is it possible to re-create a zoom-like effect for dialogs in jquery without needing to download a lightbox plugin?
i'd like to add animation to my dialogs to simulate the "zoom" effect found on this page when you click on one of the images.
without needing yet another plugin, can this be done with jQuery out of the box? would love to be able to have dialogs (modal) animate from a specific point on the screen which the user has clicked (say a button or link) into a bigger container with the appropriate content - a zoom overlay effect?
any help is greatly appreciated...
Edited:
$(function() {
$("#testdialog").dialog({
autoOpen: false,
minWidth: 425,
minHeight: 300,
position: ['center', 115],
resizable: false,
modal: true
});
$("#opener").click(function () {
$("#testdialog").dialog("open").position();
return false;
});
});
[div id="testdialog"] some content here [/div]
[input type="button" id="opener" /]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请参阅此处的以下示例。
实现此目的的一种方法是执行您想要的过渡,然后在动画结束时在回调函数中打开对话框。因此,假设您有一个大小相等的缩略图的无序列表,您可以创建一个白框
div
并使用 jQuery 将其放置在您单击的缩略图上。然后,您将开始向视口中心播放动画,并可能调整 div 的大小,然后在此动画结束时的回调中,您可以以语法方式启动对话框程序。我对 jQuery UI 对话框不太熟悉,因此您必须阅读 API 文档以了解如何执行此操作。See example of the following here.
One way you can accomplish this is to perform the transition you desire and then open the dialog in the callback function at the end of the animation. So, let's say you have an unordered list of equal sized thumbnails, you can make a
div
that's a white box and use jQuery to position it over whichever thumbnail you click. You'd then begin an animation towards the center of the viewport, and perhaps resize the div, and then in the callback at the end of this animation you can launch the dialog pro grammatically. I'm not too familiar with jQuery UI dialog, so you'll have to read the API docs for how to do this.