function clickMath() {
$("#TZMoney").val('') ;
$("#NHSY").val('');
$("#CYTS").val('');
//注释的内容是控制弹出窗口在浏览器中显示的位置,注释的内容是在浏览器的右下角,默认屏幕中间
//$('#TZJSQ').window({left:$(window).width()-300,top:$(window).height()-200});
$("#TZJSQ").window('open');
};
function TZJS() {
var result = $('#TZ').form('validate');
if(result){
var TZMoney = $("#TZMoney").val();
var NHSY = $("#NHSY").val();
var CYTS = $("#CYTS").val();
var sy = TZMoney * NHSY * CYTS / 100 /365;
$('#Sy').html(moneyFormatter(sy)+' 元');
}else{
$.messager.alert('警告','<font color="red" >请检查您的输入!</font>','warning');
return false;
}
};
//弹出框框内容
<div id="TZJSQ" class="easyui-window" closed="true" collapsible="false" minimizable="false" maximizable="false"
resizable="false" title="收益计算器" style="width: 300px; height: 200px; padding: 5px;">
<form id="TZ" action="" method="post">
<table width="100%" border="0" cellspacing="0" cellpadding="0"
class="infotab" align="center">
<tr>
<td align="right">
投资金额:
</td>
<td align="left">
<input class="easyui-validatebox" required="true"
size="15" validType="integer" maxlength="12" type="text" id="TZMoney"> 元
</td>
</tr>
<tr>
<td align="right">
年化收益率:
</td>
<td align="left">
<input type="text" required="true" class="easyui-validatebox" size="15" validType="mone" maxlength="5" id="NHSY">
%
</td>
</tr>
<tr>
<td align="right">
持有天数:
</td>
<td align="left">
<input type="text" required="true" class="easyui-validatebox" size="15" validType="integer" maxlength="5" id="CYTS"> 天
</td>
</tr>
<tr>
<td align="right">
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-ok'" οnclick="return TZJS();">计算收益</a>
</td>
<td align="left" id="Sy"/>
</tr>
</table>
</form>
</div>
注释:
class="easyui-window" ---> EasyUI窗口的class属性
closed="true" ----> 如果不加此属性,会默认加载此弹出窗口
collapsible="false" ---->窗口是否定义折叠按钮
false" ---> 是否可以最小化
maximizable="false" ----> 是否可以最大化
resizable="false" ------> 是否可以调整窗口大小
title="收益计算器" -------> 窗口标题