超过定义的范围就会固定定位,否则会跟随页面滚动
[7857f11d-c51b-4f02-9e43-ace57e9ce47f.gif]
上一节我们介绍了 DButton 和 DIcon 的实现,所以新建 affix
代码分析
dom 结构
<template>
DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Bootstrap 附加导航(Affix)插件</title>
<link
border-radius: 4px 4px 0 0;
}
ul.nav-tabs li:last-child a{
border-radius: 0 0 4px 4px;
}
ul.nav-tabs.affix
{
top: 30px; / Set the top position of pinned element */
}
</style>
<script>
("#myNav").affix({
scroll" data-target="#myScrollspy">
bootstrap affix 左侧栏导航栏
bootstrap 左边栏菜单 常用样式
相关产品
相关资讯
活动推荐