当前位置: 移动技术网 > IT编程>开发语言>JavaScript > js动画 Css提供的运动 js提供的运动

js动画 Css提供的运动 js提供的运动

2018年12月03日  | 移动技术网IT编程  | 我要评论
1. 动画 (1) Css样式提供了运动 过渡的属性transition 从一种情况到另一种情况叫过渡 Transition:attr time linear delay; Attr 是变化的属性 Time 是花费的时间 Linear 变化的速度 Delay 是延迟 复习background:url ...

1.     动画

(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

这十三个属性,前面一个是只读属性,scrolltop和scrollleft是即可读又可写

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

var aa=document.body||document.document.documentelement

scrolltop和scrolllefyt的最小值0

获取body整个文档的高

document.body.scrollheight||document.documentelement.scrollheight

获取浏览器一屏幕的高(浏览器可视区)

document.body.clientheight||document.documentelement.clientheight

window下的两个事件

        onscroll当滚动条滚动触发

        onresize当窗口改变触发

  

 

如您对本文有疑问或者有任何想说的,请 点击进行留言回复,万千网友为您解惑!

相关文章:

验证码:
移动技术网