首页 > 其他分享 >锚点

锚点

时间:2022-10-17 18:55:34浏览次数:66  
标签:Web zh scrollIntoview api 锚点 sel

   <a @click= 'goAnchor('#box')'></a>

    <div id="box"> </div>

 goAnchor(id){
      this.$sel.querySelector().scrollIntoview({
        behavior:'smooyh',
        block:'start'
      })
    }

 

scrollIntoview原生api: https://developer.mozilla.org/zh-CN/docs/Web/API/Element/scrollIntoView

标签:Web,zh,scrollIntoview,api,锚点,sel
From: https://www.cnblogs.com/shenhan001/p/16800241.html

相关文章

  • React SPA 应用 hash 路由如何使用锚点
    1、scrollIntoViewscrollIntoView方法可以让当前的元素滚动到浏览器窗口的可视区域内。它的使用方法如下:varelement=document.getElementById("box");element.scro......
  • qml教程-3-锚点anchor布局
    importQtQuick2.15Window{width:400height:600visible:trueRectangle{anchors.fill:parentcolor:'yellowgreen'}}importQtQuick......
  • 锚点(test)
    一、跳转到one二、跳转到two aljaalkdsdhkjsgdsgfdfdgfghfhgfdhgfhdeadfhghrtht#include<stdio.h>intmain(){ intx=0; inti=2; intisPrime=1;......
  • 锚点
    <template><divref="height"class="wrap"><divclass="tab"><div@click="get(v)":class="{'active':v===num}"v-for="(i,v)inlisttab":key=......
  • 使用a标签锚点实现顺滑效果
      scroll-behavior:smooth;//使用该方法使用a标签锚点的时候会实现平滑xxx.scrollIntoView({behavior:"smooth"})......