精品久久久久久亚洲精品_成人午夜网站_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;">

          国产精品18久久久久久久久久久久| 欧美偷拍一区二区| 色吊一区二区三区 | 欧美精品乱人伦久久久久久| 日韩主播视频在线| 91麻豆精品国产91久久久使用方法 | 国产午夜精品一区二区三区嫩草| 精品无人区卡一卡二卡三乱码免费卡 | 97国产一区二区| 一区二区三区电影在线播| 欧美老肥妇做.爰bbww视频| 日本sm残虐另类| 国产欧美一区二区精品性色超碰| 91久久人澡人人添人人爽欧美| 日韩主播视频在线| 中文字幕的久久| 日韩欧美亚洲一区二区| av在线播放一区二区三区| 三级欧美韩日大片在线看| 国产精品精品国产色婷婷| 91视频.com| 久久麻豆一区二区| 国产三级精品视频| 不卡高清视频专区| 麻豆91精品91久久久的内涵| 亚洲男人的天堂在线aⅴ视频| 欧美精品18+| 日本韩国一区二区三区| 成人中文字幕在线| 免费观看在线综合| 亚洲成人免费看| 亚洲靠逼com| 亚洲欧洲日产国产综合网| 精品日韩一区二区三区免费视频| 欧美天堂一区二区三区| 成+人+亚洲+综合天堂| 六月丁香婷婷久久| 日韩精品欧美精品| 亚洲国产视频一区二区| 亚洲色图制服丝袜| 国产精品成人在线观看| 午夜免费久久看| 中文字幕一区二区三区精华液| 欧美电影免费观看完整版| 欧美日韩国产一区| 欧美亚洲丝袜传媒另类| 在线观看免费视频综合| 9i看片成人免费高清| 91在线播放网址| 在线观看国产一区二区| 欧美午夜精品免费| 欧美午夜精品久久久久久孕妇| 91极品美女在线| 色欧美乱欧美15图片| 欧美无砖砖区免费| 欧美日韩精品久久久| 欧美妇女性影城| 欧美成人video| 久久久久国产精品麻豆ai换脸| 国产亚洲精品aa| 国产精品天美传媒| 亚洲狠狠丁香婷婷综合久久久| 亚洲图片一区二区| 亚洲超丰满肉感bbw| 美女网站色91| 国产99精品在线观看| www.成人网.com| 欧美日韩在线播放一区| 欧美精品丝袜中出| 日韩欧美一级在线播放| 国产日韩影视精品| 樱桃视频在线观看一区| 日本伊人午夜精品| 国产成人鲁色资源国产91色综 | 自拍视频在线观看一区二区| 一片黄亚洲嫩模| 日本不卡123| 成人黄色在线网站| 欧美日本一区二区在线观看| ww亚洲ww在线观看国产| 亚洲男帅同性gay1069| 免费视频一区二区| 国产 欧美在线| 91精品国产综合久久久久久久| 欧美激情综合网| 日韩经典中文字幕一区| 国产一本一道久久香蕉| 欧美不卡一区二区三区| 中文字幕中文在线不卡住| 免费看欧美女人艹b| 成人黄色小视频| 91.com在线观看| 亚洲欧美自拍偷拍| 国产一区二区三区免费观看 | 欧美精品在线一区二区三区| 久久一夜天堂av一区二区三区| 亚洲欧美另类在线| 狠狠色综合播放一区二区| 欧美主播一区二区三区| 国产精品卡一卡二| 国产一区二区三区四区五区美女 | 亚洲精品一区二区在线观看| 亚洲手机成人高清视频| 国内外成人在线| 欧美日产在线观看| 亚洲男帅同性gay1069| 国产精品影视在线观看| 欧美一区二区三级| 一区二区三区四区乱视频| 粉嫩13p一区二区三区| 精品久久久久久久久久久院品网| 亚洲午夜久久久久久久久电影院| 99在线视频精品| 国产精品女人毛片| 高清国产一区二区三区| 久久精品人人做人人综合 | 国产成人午夜精品影院观看视频| 69堂亚洲精品首页| 天天综合网天天综合色| 欧美亚洲动漫精品| 一区二区久久久| 欧美中文字幕久久| 亚洲成av人片在线观看| 欧美这里有精品| 亚洲国产另类av| 欧美精品一级二级三级| 99久久久精品| 日韩一区欧美一区| 色综合久久久网| 一区二区成人在线视频| 欧美剧情片在线观看| 蜜桃久久久久久久| 久久久久久久久蜜桃| 成人综合激情网| 亚洲精品写真福利| 欧美日韩精品免费观看视频| 男女男精品视频| 久久亚洲一级片| 91在线精品一区二区| 一个色综合av| 日韩精品一区二区三区视频在线观看 | 亚洲va天堂va国产va久| 欧美美女视频在线观看| 久久99国产精品久久99果冻传媒 | 精品播放一区二区| 国产91露脸合集magnet| 亚洲精品视频免费看| 91麻豆精品国产91久久久使用方法| 精品一区二区三区在线观看| 国产精品伦理在线| 欧美精品国产精品| 国产成人久久精品77777最新版本| 亚洲精品五月天| 精品国产1区二区| 在线免费不卡视频| 国产一区二区精品久久99| 亚洲嫩草精品久久| 日韩你懂的在线观看| www.亚洲激情.com| 天堂在线亚洲视频| 国产精品短视频| 欧美一区二区三区视频在线观看| 国产成人精品三级| 日本一不卡视频| 亚洲日韩欧美一区二区在线| 精品国产乱码久久久久久1区2区| 色一情一乱一乱一91av| 久久精品国产色蜜蜜麻豆| 亚洲精选免费视频| 国产免费观看久久| 欧美xxxx老人做受| 欧美亚洲动漫精品| 欧美日本韩国一区| 色综合天天综合网天天看片| 国内精品视频一区二区三区八戒| 亚洲精品视频免费观看| 国产精品私房写真福利视频| 日韩女优制服丝袜电影| 欧美欧美午夜aⅴ在线观看| 99精品视频在线播放观看| 国产剧情一区在线| 玖玖九九国产精品| 日韩黄色免费电影| 香港成人在线视频| 亚洲国产精品精华液网站| 日韩码欧中文字| 国产精品美女久久久久aⅴ| 精品国产乱码久久久久久久| 日韩欧美自拍偷拍| 欧美乱妇一区二区三区不卡视频| 欧美性一区二区| 欧美色综合网站| 欧美日韩一区在线观看| 欧美亚洲一区二区在线| 欧美性videosxxxxx| 欧美综合亚洲图片综合区| 在线观看日韩av先锋影音电影院| 91社区在线播放| 色婷婷久久综合| 欧美日韩亚洲另类|