Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

我的学习日志(四) #5

Open
1 task
xxxgitone opened this issue Jun 6, 2017 · 0 comments
Open
1 task

我的学习日志(四) #5

xxxgitone opened this issue Jun 6, 2017 · 0 comments

Comments

@xxxgitone
Copy link
Owner

xxxgitone commented Jun 6, 2017

终于又回到学校了,在家待了几天,每天就简单的写了点代码,也没有学习其他的知识。在家还是没那个气氛,回家见了很多朋友,暑假不打算在家,所以把要见的人,要做的事都做了,回学校安安心心学习。

任务:

  • vnpastime播放器增加功能

今天又重新用到很久以前学习到的知识点getBoundingClientRect()

这个方法返回一个矩形对象,包含六个属性,除了left、top、right和bottom,还包含自身的width和height

使用一个dom对象

   const clientRect = domObj.getBoundingClientRect()
   clientRect.top //元素上边距离页面上边的距离
   clientRect.right //元素右边距离页面左边的距离 
   ......  //其他类似

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant