【发布时间】:2011-08-18 12:54:49
【问题描述】:
我希望当 LightFace 显示时,一个繁忙的图像应该出现并显示在模态框的中心。我发现当内容将在后台加载时,无法以编程方式显示带有繁忙图像的 LightFace。所以我使用了一个技巧但没有奏效。在我的例子中,繁忙的图像显示在对话框中,但不在中心位置。
这是我的代码
这里我为我的 div 定义了一个样式表
.BusyStyles
{ 背景图像: url('images/fbloader.gif'); 背景重复:不重复;背景位置:中心中心; 身高:200; 宽度:300; }
我的 JavaScript 是
<script language="javascript" type="text/javascript">
jQuery.noConflict();
jQuery(document).ready(function () {
jQuery("#btnFeedback1").click(function () {
var modal = new LightFace({
draggable: true,
height: 200,
width: 300,
title: 'My Profile',
content: '<div css="BusyStyles"><div>',
buttons: [
{ title: 'OK', event: function () { this.close(); } },
{ title: 'Close', event: function () { this.close(); } }
]
});
modal.open();
modal.load('here i will load my ajax content calling pagemethod');
return false;
});
});
所以我做了什么,当我显示 LightFace 模式对话框时,一个 div 被分配为具有样式表的默认内容。样式表具有固定的高度和宽度,并作为背景图像。我试图在中心显示图像,但图像没有显示在中心,而是图像显示在左上位置。
所以请指导我如何在对话框的中心显示忙碌的图像。
基本上我希望当我通过 jquery 调用服务器端函数时,我的对话框应该显示繁忙的图像,并且当内容可用时,我将显示该内容。 我正在使用 asp.net 并通过 jquery 调用页面方法。
请指导我。谢谢。
【问题讨论】:
-
这与 mootools 有什么关系?