利用动态图添加Loading动画
2015-12-17 17:08
211 查看
opacity:CSS3中的属性,调节透明度,一般取值0.5
添加思想:
1.对超链接添加点击事件,通过new {@onclick="showLoading()"}
2.在<body>中添加div
3.编写样式
4.showLoading函数
5.在ifame子窗口中添加如下javascript代码
6.在父窗口中添加hiddenLoading函数
添加思想:
1.对超链接添加点击事件,通过new {@onclick="showLoading()"}
Html.ActionLink("新建产品",“Create","ProductManage", new{productLineID = productLineList[i].ID}, new{target = "Conframe",@class="create",@onclick="showLoading()"})
2.在<body>中添加div
<div id="loadingover" class="loadingover"></div> <div id="loadinglayout" class="loadinglayout"> <img src="loading.jpg" alt="页面正在加载中..." /> </div>
3.编写样式
<style type="text/css"> .loadingover { display: none; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: #f5f5f5; opacity:0.5; z-index: 1000; } .loadinglayout { display: none; position: absolute; top: 40%; left: 40%; width: 20%; height: 20%; z-index: 1001; text-align:center; } </style>
4.showLoading函数
<script> function showLoading(){ document.getElementById("loadinglayout").style.display = "block"; document.getElementById("loadingimg").style.display = "block"; } </script>
5.在ifame子窗口中添加如下javascript代码
<script> $(window).load(function(){ window.parent.hiddenLoading(); }) </script>
6.在父窗口中添加hiddenLoading函数
<script> function showLoading(){ document.getElementById("loadinglayout").style.display = "none"; document.getElementById("loadingimg").style.display = "none"; } </script>
相关文章推荐
- 如何讲CM Android移植到你的设备?
- 解决IE9支持CSS中文字体经验篇
- 老李分享:loadrunne动态查询db2数据库
- GDB的字符终端的替换工具——CGDB的使用与介绍
- 第11章 Camera
- PrefixSpan序列模式挖掘算法
- 什么是scipy、numpy、matplotlib?
- repo自动下载
- RabbitMQ学习之三: 发布/订阅(广播方式fanout)
- Android——观察者模式
- 关于rem的学习
- 03-position和anchorPoint
- 老李分享:loadrunner操作mysql数据库
- 计算机启动流程
- LAMP or LNMP 一键安装脚本
- winxp系统不能安装新字体该怎么办?
- 老李分享:Python开发性能测试脚本
- UITextView 实现 placeholder
- OS维修总结
- 清理Xcode