2010-02-20 71 views
0

我想创建弹出使用jqueryui对话框。我正在尝试在对话框中的内容之后添加页脚。应该如何添加页脚到jquery中的弹出对话框?

我喜欢的对话框

<popup> 
header-html 
content-html 
footer-html 
</popup> 

对话框已经有头,我可以把内容在div。 但是,如何添加页脚html?

我希望这个页脚可以在网站上的所有弹出窗口中显示。

回答

2

您的当前内容的容器就分离成内容和页脚的div:

<div class="dialogContent"> 
    <div class="content">Your existing content</div> 
    <div class="footer">The common footer stuff</div> 
</div> 

然后把该对话框的内容中。

+0

对此的一个改变是,我将所有的jquery对话调用通过rapper函数传递给jquery.dialog,并将footer div html添加到该函数内的dialogContent div中。 – 2010-03-09 11:37:33

0

你的Html是什么样的?我想像这样的事情:

<div class="popup"> 
    <div class="header"></div> 
    <div class="content"></div> 
    <div class="footer"></div> 
</div> 

...然后油嘴回答你的问题是“你把内容插入到页眉和内容部分以同样的方式。”

jQuery中它会是这样的:

$(".footer").html("Hello World!"); 
+0

实际上头div是由jquery生成的。所以HTML就像 content here

。 jquery对话框只会询问内容div的ID(我不能给它两个div ID,并且说一个是页脚,一个是内容),并且它将头部包裹在它的周围。 – 2010-03-23 06:26:55

0

这里是我如何做我的...它不是风格,但如果你想这是如何你可以做到这一点。

如果你把与类“mypopup”一个层到对话框,那么你可以做到以下几点:

$('.mypopup').parent().append('<div id="footer" style="position:absolute;display:none;bottom:0;float:left;width:98%;background-color:#c9c9c9;padding:5px;"></div>');

,这将使该对话框上的“卡壳”的页脚,希望这将引导你在正确的方向......虽然我希望对话框UI元素有一个实际的“状态栏”或“页脚”区域选项。