前端页面添加判断语句+定时刷新+伸缩页面

html页<!--[if IE]>...<![endif]-->使用解说

1、以下判断条件,当disk.capacity大于100的时候,显示MB,否则显示TB;

<td>{{ disk.capacity|default:'N/A' }}{% if disk.capacity >= 100 %}MB{%else%}TB{%endif%}</td>

2、前端本页面定时刷新:

(1)前端页面5秒一刷新:

<meta http-equiv="refresh" content="5">

(2)前端页面5秒之后跳到百度页面:

<meta http-equiv="refresh" content="5"; url="www.baiducom">

3、前端页面加伸缩功能:

<div id="openRow"><b>其他信息:</b></div>
<table id="other" border="1" class="table table-responsive" style="border-left:3px solid deepskyblue;border-bottom:1px solid deepskyblue">
<thead>
<tr>
<th>合同</th>
<th>价格</th>
<th>购买日期</th>
<th>过保日期</th>
<th>管理员</th>
<th>批准人</th>
<th>备注</th>
<th>批准日期</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ asset.contract.name|default:'N/A' }}</td>
<td>{{ asset.price|default:'N/A' }}</td>
<td>{{ asset.purchase_day|default:'N/A' }}</td>
<td>{{ asset.expire_day|default:'N/A' }}</td>
<td>{{ asset.admin|default:'N/A' }}</td>
<td>{{ asset.approved_by|default:'N/A' }}</td>
<td>{{ asset.memo|default:'N/A' }}</td>
<td>{{ asset.c_time|default:'N/A' }}</td>
</tr>
</tbody>
</table>
</div>
<script>
window.οnlοad=function(){
var other=function(e,type){ //没有var声明在ie上会报错
if(!type){
e.style.display="none";//隐藏指定的行元素
}
else {
e.style.display="table-row"; //table-row设置此元素会作为一个表格行显示
}
}
var _other=document.getElementById("other"),statu=true;
// _other.style.display = 'none';
var fn = function(){ //展开一行 openRow
statu=!statu;
other(_other.rows[0],statu);
other(_other.rows[1],statu);
}
document.getElementById("openRow").οnclick= fn
fn();
}
</script>


转载于:https://www.cnblogs.com/haoxinchen/p/9530975.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值