http://www.ericmmartin.com/projects/simplemodal/SimpleModal和Jquery(如何打开和关闭动画)?
页面底部附近有两个示例,显示如何打开或关闭动画。
我很新jquery。我如何声明onOpen和onClose? (我只能够得到一次一个工作
jQuery(function ($) {
$('a.basic').click(function (e) {
e.preventDefault();
$('#basic-modal-content').modal(
{
onClose: function (dialog)
{
dialog.container.fadeOut('slow', function() {
});
}
}
);
});
});
感谢您的帮助,您可以提供
是否有方式来设置它与任何模式窗口?而不是每次都必须声明每一个dif(在这种情况下“basic-modal-conent”)有没有办法让所有模态窗口的动画都一样? 也有,因为某些原因,当我把onOpen并按照你的建议,当窗口打开时它会立即关闭 – Matthew 2010-03-22 18:03:25
要定位所有的模态,你应该为每个需要的DOM元素添加一个'模态'类,然后定位$('。modal')。你发布你的确切代码onOpen,并onClose? – ground5hark 2010-03-22 18:10:09
事情是,每一个都是唯一的。例如,一个页面上可能有两个链接。一个标题为“注册”的另一个标题为“联系人”的链接。 div的id为“simplemodal-register”,联系人应该打开“simplemodal-contact”。我将在网站上有几个这样的代码,所以我宁愿将代码缩写为不重写每个div需要 示例代码位于:http://www.ericmmartin.com/projects/simplemodal/#example-10 感谢您的帮助。 – Matthew 2010-03-22 18:16:47