11-19 动画

1.Css样式提供了运动

  过渡的属性transition  从一种情况到另一种情况叫过渡

  Transition:attr  time  linear  delay

  Attr 是变化的属性

  Time 是花费的时间

  Linear 变化的速度

  Delay 是延迟

 

复习:background:url() no-repeat 50% 50% red;

 

   background-image

 

   background-repeat

 

   background-position

 

   background-color

2. Js提供的运动

 

  元素的client offset scroll三个系列:

 

  clientWidth/clientHeight/clientTop/clientLeft

 

  offsetWidth/offsetHeight/offsetLeft/offsetTop/offsetParent

 

  scrollWidth/scrollHeight/scrollTop/scrollLeft

 

  这十三个属性,前面十一个是只读属性,scrollTopscrollLeft是即可读也可写

 

  获取浏览器的body属性是有兼容的

 

    Var dd=document.body||document.documentElement

 

  scrollTopscrollLeft的最小值是0

 

获取body的整个文档的高:document.body.scrollHeight||document.documentElement.scrollHeight

 

获取浏览器一屏幕的高(浏览器的可视区):Document.body.clientHeight||document.documentElement.clientHeight

 

Window下的两个事件

 

  onscroll 当滚动条滚动的时候触发

 

  onresize 当窗口发生改变时触发

 

 

猜你喜欢

转载自www.cnblogs.com/wwwzhaocom/p/10044111.html