精品久久久久久亚洲精品_成人午夜网站_www日本高清_亚洲精品久久久久午夜福

Scrollspy

Automatically update Bootstrap navigation or list group components based on scroll position to indicate which link is currently active in the viewport.

How it works

Scrollspy has a few requirements to function properly:

  • It must be used on a Bootstrap nav component or list group.
  • Scrollspy requires position: relative; on the element you’re spying on, usually the <body>.
  • Anchors (<a>) are required and must point to an element with that id.

When successfully implemented, your nav or list group will update accordingly, moving the .active class from one item to the next based on their associated targets.

Scrollable containers and keyboard access

If you’re making a scrollable container (other than the <body>), be sure to have a height set and overflow-y: scroll; applied to it—alongside a tabindex="0" to ensure keyboard access.

Example in navbar

Scroll the area below the navbar and watch the active class change. The dropdown items will be highlighted as well.

@fat

Placeholder content for the scrollspy example. You got the finest architecture. Passport stamps, she's cosmopolitan. Fine, fresh, fierce, we got it on lock. Never planned that one day I'd be losing you. She eats your heart out. Your kiss is cosmic, every move is magic. I mean the ones, I mean like she's the one. Greetings loved ones let's take a journey. Just own the night like the 4th of July! But you'd rather get wasted.

@mdo

Placeholder content for the scrollspy example. 'Cause she's the muse and the artist. (This is how we do) So you wanna play with magic. So just be sure before you give it all to me. I'm walking, I'm walking on air (tonight). Skip the talk, heard it all, time to walk the walk.

one

Placeholder content for the scrollspy example. Takes you miles high, so high, 'cause she’s got that one international smile. There's a stranger in my bed, there's a pounding in my head. Oh, no. In another life I would make you stay. ‘Cause I, I’m capable of anything. Suiting up for my crowning battle. Used to steal your parents' liquor and climb to the roof. Tone, tan fit and ready, turn it up cause its gettin' heavy. Her love is like a drug. I guess that I forgot I had a choice.

two

Placeholder content for the scrollspy example. It's time to bring out the big balloons. I'm walking, I'm walking on air (tonight). Yeah, we maxed our credit cards and got kicked out of the bar. Yo, shout out to all you kids, buying bottle service, with your rent money. I'm ma get your heart racing in my skin-tight jeans. If you get the chance you better keep her. Yo, shout out to all you kids, buying bottle service, with your rent money.

three

Placeholder content for the scrollspy example. If you wanna dance, if you want it all, you know that I'm the girl that you should call. Walk through the storm I would. So let me get you in your birthday suit. The one that got away. Last Friday night, yeah I think we broke the law, always say we're gonna stop. 'Cause she's a little bit of Yoko, And she's a little bit of 'Oh no'. I want the jaw droppin', eye poppin', head turnin', body shockin'. Yeah, we maxed our credit cards and got kicked out of the bar.

And some more placeholder content, for good measure.

<nav id="navbar-example2" class="navbar navbar-light bg-light px-3">
  <a class="navbar-brand" href="#">Navbar</a>
  <ul class="nav nav-pills">
    <li class="nav-item">
      <a class="nav-link" href="#fat">@fat</a>
    </li>
    <li class="nav-item">
      <a class="nav-link" href="#mdo">@mdo</a>
    </li>
    <li class="nav-item dropdown">
      <a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-expanded="false">Dropdown</a>
      <ul class="dropdown-menu dropdown-menu-end">
        <li><a class="dropdown-item" href="#one">one</a></li>
        <li><a class="dropdown-item" href="#two">two</a></li>
        <li><hr class="dropdown-divider"></li>
        <li><a class="dropdown-item" href="#three">three</a></li>
      </ul>
    </li>
  </ul>
</nav>
<div data-bs-spy="scroll" data-bs-target="#navbar-example2" data-bs-offset="0" tabindex="0">
  <h4 id="fat">@fat</h4>
  <p>...</p>
  <h4 id="mdo">@mdo</h4>
  <p>...</p>
  <h4 id="one">one</h4>
  <p>...</p>
  <h4 id="two">two</h4>
  <p>...</p>
  <h4 id="three">three</h4>
  <p>...</p>
</div>

Example with nested nav

Scrollspy also works with nested .navs. If a nested .nav is .active, its parents will also be .active. Scroll the area next to the navbar and watch the active class change.

Item 1

Placeholder content for the scrollspy example. This one relates to item 1. Takes you miles high, so high, 'cause she’s got that one international smile. There's a stranger in my bed, there's a pounding in my head. Oh, no. In another life I would make you stay. ‘Cause I, I’m capable of anything. Suiting up for my crowning battle. Used to steal your parents' liquor and climb to the roof. Tone, tan fit and ready, turn it up cause its gettin' heavy. Her love is like a drug. I guess that I forgot I had a choice.

Item 1-1

Placeholder content for the scrollspy example. This one relates to the item 1-1. You got the finest architecture. Passport stamps, she's cosmopolitan. Fine, fresh, fierce, we got it on lock. Never planned that one day I'd be losing you. She eats your heart out. Your kiss is cosmic, every move is magic. I mean the ones, I mean like she's the one. Greetings loved ones let's take a journey. Just own the night like the 4th of July! But you'd rather get wasted.

Item 1-2

Placeholder content for the scrollspy example. This one relates to the item 1-2. Her love is like a drug. All my girls vintage Chanel baby. Got a motel and built a fort out of sheets. 'Cause she's the muse and the artist. (This is how we do) So you wanna play with magic. So just be sure before you give it all to me. I'm walking, I'm walking on air (tonight). Skip the talk, heard it all, time to walk the walk. Catch her if you can. Stinging like a bee I earned my stripes.

Item 2

Placeholder content for the scrollspy example. This one relates to item 2. Don't need apologies. There is no fear now, let go and just be free, I will love you unconditionally. Last Friday night. Don't be a shy kinda guy I'll bet it's beautiful. Summer after high school when we first met. 'Cause she's the muse and the artist. What? Wait. No, no, no, no. Thought that I was the exception.

Item 3

Placeholder content for the scrollspy example. This one relates to item 3. Word on the street, you got somethin' to show me, me. All this money can't buy me a time machine. Make it like your birthday everyday. So we hit the boulevard. You make me feel like I'm livin' a teenage dream, the way you turn me on Skip the talk, heard it all, time to walk the walk. Word on the street, you got somethin' to show me, me. It's no big deal, it's no big deal, it's no big deal.

Item 3-1

Placeholder content for the scrollspy example. This one relates to item 3-1. Baby do you dare to do this? This is no big deal. Yeah, you're lucky if you're on her plane. Just own the night like the 4th of July! Standing on the frontline when the bombs start to fall. So just be sure before you give it all to me.

Item 3-2

Placeholder content for the scrollspy example. This one relates to item 3-2. You're original, cannot be replaced. All night they're playing, your song. California girls we're undeniable. Like a bird without a cage. There is no fear now, let go and just be free, I will love you unconditionally. I can see the writing on the wall. You could travel the world but nothing comes close to the golden coast.

<nav id="navbar-example3" class="navbar navbar-light bg-light">
  <a class="navbar-brand" href="#">Navbar</a>
  <nav class="nav nav-pills flex-column">
    <a class="nav-link" href="#item-1">Item 1</a>
    <nav class="nav nav-pills flex-column">
      <a class="nav-link ms-3 my-1" href="#item-1-1">Item 1-1</a>
      <a class="nav-link ms-3 my-1" href="#item-1-2">Item 1-2</a>
    </nav>
    <a class="nav-link" href="#item-2">Item 2</a>
    <a class="nav-link" href="#item-3">Item 3</a>
    <nav class="nav nav-pills flex-column">
      <a class="nav-link ms-3 my-1" href="#item-3-1">Item 3-1</a>
      <a class="nav-link ms-3 my-1" href="#item-3-2">Item 3-2</a>
    </nav>
  </nav>
</nav>

<div data-bs-spy="scroll" data-bs-target="#navbar-example3" data-bs-offset="0" tabindex="0">
  <h4 id="item-1">Item 1</h4>
  <p>...</p>
  <h5 id="item-1-1">Item 1-1</h5>
  <p>...</p>
  <h5 id="item-1-2">Item 1-2</h5>
  <p>...</p>
  <h4 id="item-2">Item 2</h4>
  <p>...</p>
  <h4 id="item-3">Item 3</h4>
  <p>...</p>
  <h5 id="item-3-1">Item 3-1</h5>
  <p>...</p>
  <h5 id="item-3-2">Item 3-2</h5>
  <p>...</p>
</div>

Example with list-group

Scrollspy also works with .list-groups. Scroll the area next to the list group and watch the active class change.

Item 1

Placeholder content for the scrollspy list-group example. This one relates to item 1. Don't need apologies. There is no fear now, let go and just be free, I will love you unconditionally. Last Friday night. Don't be a shy kinda guy I'll bet it's beautiful. Summer after high school when we first met. 'Cause she's the muse and the artist. What? Wait. Thought that I was the exception.

Item 2

Placeholder content for the scrollspy list-group example. This one relates to item 2. Yeah, she dances to her own beat. Oh, no. You could've been the greatest. 'Cause, baby, you're a firework. Maybe a reason why all the doors are closed. Open up your heart and just let it begin. So très chic, yeah, she's a classic.

Item 3

Placeholder content for the scrollspy list-group example. This one relates to item 3. We go higher and higher. Never one without the other, we made a pact. I'm walking on air. Someone said you had your tattoo removed. Now I’m floating like a butterfly. Tone, tan fit and ready, turn it up cause its gettin' heavy. Cause once you’re mine, once you’re mine. You just gotta ignite the light and let it shine! So we hit the boulevard. Do you ever feel, feel so paper thin. I see it all, I see it now.

Item 4

Placeholder content for the scrollspy list-group example. This one relates to item 4. Summer after high school when we first met. There is no fear now, let go and just be free, I will love you unconditionally. Sun-kissed skin so hot we'll melt your popsicle. This love will make you levitate.

<div id="list-example" class="list-group">
  <a class="list-group-item list-group-item-action" href="#list-item-1">Item 1</a>
  <a class="list-group-item list-group-item-action" href="#list-item-2">Item 2</a>
  <a class="list-group-item list-group-item-action" href="#list-item-3">Item 3</a>
  <a class="list-group-item list-group-item-action" href="#list-item-4">Item 4</a>
</div>
<div data-bs-spy="scroll" data-bs-target="#list-example" data-bs-offset="0" class="scrollspy-example" tabindex="0">
  <h4 id="list-item-1">Item 1</h4>
  <p>...</p>
  <h4 id="list-item-2">Item 2</h4>
  <p>...</p>
  <h4 id="list-item-3">Item 3</h4>
  <p>...</p>
  <h4 id="list-item-4">Item 4</h4>
  <p>...</p>
</div>

Usage

Via data attributes

To easily add scrollspy behavior to your topbar navigation, add data-bs-spy="scroll" to the element you want to spy on (most typically this would be the <body>). Then add the data-bs-target attribute with the ID or class of the parent element of any Bootstrap .nav component.

body {
  position: relative;
}
<body data-bs-spy="scroll" data-bs-target="#navbar-example">
  ...
  <div id="navbar-example">
    <ul class="nav nav-tabs" role="tablist">
      ...
    </ul>
  </div>
  ...
</body>

Via JavaScript

After adding position: relative; in your CSS, call the scrollspy via JavaScript:

var scrollSpy = new bootstrap.ScrollSpy(document.body, {
  target: '#navbar-example'
})

Resolvable ID targets required

Navbar links must have resolvable id targets. For example, a <a href="#home">home</a> must correspond to something in the DOM like <div id="home"></div>.

Non-visible target elements ignored

Target elements that are not visible will be ignored and their corresponding nav items will never be highlighted.

Methods

refresh

When using scrollspy in conjunction with adding or removing of elements from the DOM, you’ll need to call the refresh method like so:

var dataSpyList = [].slice.call(document.querySelectorAll('[data-bs-spy="scroll"]'))
dataSpyList.forEach(function (dataSpyEl) {
  bootstrap.ScrollSpy.getInstance(dataSpyEl)
    .refresh()
})

dispose

Destroys an element’s scrollspy. (Removes stored data on the DOM element)

getInstance

Static method which allows you to get the scrollspy instance associated with a DOM element

var scrollSpyContentEl = document.getElementById('content')
var scrollSpy = bootstrap.ScrollSpy.getInstance(scrollSpyContentEl) // Returns a Bootstrap scrollspy instance

Options

Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-bs-, as in data-bs-offset="".

Name Type Default Description
offset number 10 Pixels to offset from top when calculating position of scroll.
method string auto Finds which section the spied element is in. auto will choose the best method to get scroll coordinates. offset will use the Element.getBoundingClientRect() method to get scroll coordinates. position will use the HTMLElement.offsetTop and HTMLElement.offsetLeft properties to get scroll coordinates.
target string | jQuery object | DOM element Specifies element to apply Scrollspy plugin.

Events

Event type Description
activate.bs.scrollspy This event fires on the scroll element whenever a new item becomes activated by the scrollspy.
var firstScrollSpyEl = document.querySelector('[data-bs-spy="scroll"]')
firstScrollSpyEl.addEventListener('activate.bs.scrollspy', function () {
  // do something...
})
返回頂部
精品久久久久久亚洲精品_成人午夜网站_www日本高清_亚洲精品久久久久午夜福

      9000px;">

          国产亚洲精品资源在线26u| 日韩一区二区在线观看视频| 人人狠狠综合久久亚洲| 国产精品动漫网站| 欧美国产精品久久| 国产丝袜在线精品| 久久精品亚洲麻豆av一区二区| 日韩女同互慰一区二区| 欧美区在线观看| 欧美日韩一级片在线观看| 欧美中文字幕亚洲一区二区va在线 | 欧美午夜精品免费| 欧美性大战久久久久久久蜜臀 | 九九九精品视频| 久久精品国内一区二区三区| 日本中文字幕不卡| 午夜精品爽啪视频| 久久综合综合久久综合| 精品在线免费观看| 国产电影一区在线| 99麻豆久久久国产精品免费优播| 91丨porny丨户外露出| 色综合久久久网| 欧美精三区欧美精三区| 777久久久精品| 久久久激情视频| 欧美国产精品中文字幕| 亚洲女同一区二区| 日韩中文字幕一区二区三区| 青青草原综合久久大伊人精品| 国产乱对白刺激视频不卡| 福利一区二区在线| 欧美日韩成人综合| 精品国产免费视频| 国产精品国产精品国产专区不蜜| 亚洲一线二线三线久久久| 日本欧美韩国一区三区| 国产一区二区在线视频| 99久久777色| 日韩欧美一级精品久久| 国产精品午夜在线| 日本欧美在线看| 国产一区二区免费视频| 91蝌蚪porny九色| 精品少妇一区二区三区在线播放 | 蜜臀久久久99精品久久久久久| 国产精品亚洲午夜一区二区三区| 99国产精品国产精品毛片| 欧美一区二区免费观在线| 国产精品欧美一区喷水| 亚洲成av人影院| 成人av网在线| 日韩午夜小视频| 亚洲精品成人悠悠色影视| 国产美女久久久久| 日韩一卡二卡三卡四卡| 亚洲视频在线一区观看| 国产在线视频一区二区| 欧美日韩午夜影院| 亚洲欧美aⅴ...| 成人免费三级在线| 久久久蜜桃精品| 免费看欧美女人艹b| 在线观看免费成人| 成人欧美一区二区三区小说| 久久精品噜噜噜成人88aⅴ| 欧美体内she精视频| 亚洲同性gay激情无套| 国产精品 日产精品 欧美精品| 91精品国产黑色紧身裤美女| 中文字幕在线一区二区三区| 国产传媒久久文化传媒| 日韩欧美电影一二三| 亚洲不卡在线观看| 欧美日韩一区二区三区高清 | 久久综合九色欧美综合狠狠| 日本在线不卡视频一二三区| 日本高清免费不卡视频| 亚洲特级片在线| 色哟哟一区二区在线观看| 亚洲欧美日韩在线播放| 风间由美一区二区三区在线观看 | www.性欧美| 自拍偷拍欧美激情| 国产成都精品91一区二区三| 久久久久97国产精华液好用吗| 久久精品噜噜噜成人av农村| 精品国产精品网麻豆系列| 另类小说欧美激情| 精品国产乱码久久久久久老虎| 久久99精品久久久久| 久久色中文字幕| 丁香天五香天堂综合| 亚洲特级片在线| 在线观看区一区二| 美日韩一级片在线观看| 精品国产免费一区二区三区四区 | 亚洲国产日韩在线一区模特| 91精品国产综合久久久久久漫画| 蜜臀va亚洲va欧美va天堂| 2020日本不卡一区二区视频| 国产精品一二三区在线| 亚洲精品免费播放| 56国语精品自产拍在线观看| 精品夜夜嗨av一区二区三区| 中文字幕第一页久久| 欧美一a一片一级一片| 欧美96一区二区免费视频| 26uuuu精品一区二区| av中文字幕亚洲| 亚洲mv在线观看| 精品久久人人做人人爽| aa级大片欧美| 午夜国产精品一区| 久久先锋影音av| 欧美又粗又大又爽| 美女视频黄免费的久久| 国产精品久久久久久久岛一牛影视 | 成人动漫av在线| 偷拍日韩校园综合在线| 国产欧美精品一区aⅴ影院| 日本韩国欧美一区| 日本免费在线视频不卡一不卡二| 欧美经典一区二区| 51精品久久久久久久蜜臀| zzijzzij亚洲日本少妇熟睡| 免费三级欧美电影| 亚洲综合在线视频| 国产精品理论在线观看| 日韩你懂的在线观看| 欧美系列在线观看| 成人午夜大片免费观看| 日本在线不卡视频| ...xxx性欧美| 亚洲国产精品国自产拍av| 制服.丝袜.亚洲.中文.综合| 波多野结衣视频一区| 激情综合一区二区三区| 亚洲a一区二区| 一区二区三区在线播| 精品视频999| 色欧美片视频在线观看在线视频| 国产一区二区不卡| 久久91精品国产91久久小草| 天天综合日日夜夜精品| 亚洲乱码日产精品bd| 国产精品久久久久aaaa| 日本一区二区三区国色天香| 久久久久久久电影| 久久亚洲二区三区| 久久久久青草大香线综合精品| 欧美电视剧免费全集观看| 欧美人狂配大交3d怪物一区| 欧美色倩网站大全免费| 91福利社在线观看| 色婷婷精品久久二区二区蜜臂av | 久久久久久电影| 久久精品视频在线看| 国产亚洲欧洲997久久综合| 精品国产一区二区精华| 精品久久人人做人人爰| 久久夜色精品国产噜噜av| 亚洲精品在线免费播放| 久久免费精品国产久精品久久久久| 日韩精品资源二区在线| 精品国产亚洲在线| 国产精品三级av在线播放| 中文一区一区三区高中清不卡| 中文字幕一区二区在线观看| 亚洲色图欧洲色图婷婷| 亚洲自拍偷拍av| 日韩黄色免费电影| 激情综合色综合久久综合| 国产成人av电影在线观看| 大白屁股一区二区视频| 91视频一区二区| 欧美日韩亚洲综合| 欧美xxxx在线观看| 最新国产の精品合集bt伙计| 亚洲一区国产视频| 久久99久久精品| 99久久婷婷国产综合精品| 欧美片在线播放| 亚洲国产成人午夜在线一区| 综合电影一区二区三区 | 精品成人佐山爱一区二区| 中文欧美字幕免费| 亚洲福利一二三区| 国产乱码精品一区二区三区av| 91色在线porny| 欧美一区二区三区免费观看视频| 国产色综合一区| 五月综合激情婷婷六月色窝| 国产乱码精品一品二品| 日本久久电影网| 欧美大片一区二区三区| 亚洲私人黄色宅男| 国产麻豆精品theporn| 91久久精品网| 国产精品毛片大码女人|