美文网首页
html5的scrollIntoView()方法

html5的scrollIntoView()方法

作者: 蔷薇心情 | 来源:发表于2018-03-21 16:26 被阅读0次

支持scrollIntoView()方法的浏览器有IE、Firefox、Safari 和Opera。

用法:

                        var anchor = document.getElementById('#screenOne');

                        anchor.scrollIntoView(true)

参数true或‘’

                元素顶部与视口对齐

参数false

                元素底部与视口对齐

相关文章

网友评论

      本文标题:html5的scrollIntoView()方法

      本文链接:https://www.haomeiwen.com/subject/gyigqftx.html