<img src="data:image/1188695.png" alt="taobao" trueImg="image/1.jpg" id="img"/>

js

var img=document.querySelector("#img");
window.setTimeout(function (){
var oImg=document.createElement('img');
oImg.src=img.getAttribute('trueImg');
oImg.onload=function(){
img.src=this.src;
oImg=null;
}
},500);

所有的事件绑定都是异步编程

js盒子模型:
clientHeight=内容的高度+上下填充;
offsetHeight=clientHeight+上下边框;
clientTop=borderTop;
offsetTop:父级定位元素的上偏移量->margin(自己最外边到border)
scrollHeight:一般都是约数,在不同的浏览器中获取到的结果是不同的

scrollTop:滚动条减去的宽度或者高度

document.documentElement.scrollTop=0;
document.body.scrollTop=0;

<a href="javascript:void 0;">跳转页面</a>

取消a标签默认行为

<a href="#">跳转页面</a>

刷新当前页面

var timer1=setTimeout(function(){
console.log(11);
},1000);

console.log(timer1);
window.clearTimeout(1);

最新文章

  1. IIS Connection Timeout vs httpRuntime executionTimeout
  2. ubuntu 服务管理
  3. 静默安装oracle11G
  4. 【转】fread函数和fwrite函数
  5. C/C++堆栈指引(转)
  6. MySQL在大数据Limit使用
  7. 详解常用的gulp命令
  8. tty各种设备的情况
  9. EDB日志配置-慢sql记录分析
  10. mysql登录1045错误时 修改登录密码
  11. 做接口自动化时候,一些登录头信息可以通过aop的方式进行增强
  12. ps -ef | grep Linux进程查看命令
  13. LabVIEW--为控件添加说明信息
  14. Oracle11g 体系结构
  15. CSS属性大全
  16. Vuejs选项卡案例
  17. tile38 复制配置
  18. AMD 与CMD
  19. 基于express+mongodb+pug的博客系统——后台篇
  20. 浅谈iOS内存管理机制

热门文章

  1. 左上角小猫猫直达博主GitHub \-_-/
  2. Center os6.5 mysql
  3. 【串线篇】Mybatis之模糊查询
  4. 第01章 Spring概述
  5. bzoj3812 主旋律 容斥+状压 DP
  6. 环境变量,env, set
  7. 英语单词escapes
  8. 自定义combiner实现文件倒排索引
  9. 【Linux】批量结束某一脚本的进程
  10. Unity编程标准导引-1.1下载和安装Unity