精品久久久久久亚洲精品_成人午夜网站_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日本高清_亚洲精品久久久久午夜福

      久久久99久久精品女同性| 亚洲缚视频在线观看| 免播放器亚洲一区| 最近中文字幕日韩精品| 国产精品久久久久久亚洲毛片| 久久亚洲精品中文字幕冲田杏梨| 99亚洲一区二区| 在线欧美不卡| 国产欧美日韩在线播放| 欧美激情1区| 久热精品视频在线| 欧美在线视频一区二区| 一二三区精品福利视频| 亚洲国产一区在线| 黄色精品一二区| 国产精品久久777777毛茸茸| 欧美极品aⅴ影院| 久久久亚洲午夜电影| 亚洲一区二区三区在线| 亚洲高清在线播放| 伊人色综合久久天天五月婷| 国产一区白浆| 国模叶桐国产精品一区| 国产欧美日韩一区二区三区| 国产欧美精品va在线观看| 国产精品成人免费精品自在线观看| 欧美日韩国产经典色站一区二区三区| 美女脱光内衣内裤视频久久网站| 久久久久久电影| 久久久国产亚洲精品| 久久精品国产亚洲一区二区| 性欧美精品高清| 久久国产精品亚洲va麻豆| 久久久久久一区| 久久一区亚洲| 欧美精品二区| 欧美性大战久久久久久久| 国产精品国色综合久久| 国产精品色网| 国产亚洲毛片在线| 伊人天天综合| 日韩系列在线| 亚洲一区免费视频| 欧美在线三级| 裸体女人亚洲精品一区| 欧美大片国产精品| 欧美日韩一区二区精品| 国产免费观看久久| 黄色成人在线网站| 亚洲高清久久| 亚洲影院色在线观看免费| 欧美在线看片| 欧美精品免费播放| 国产麻豆精品视频| 亚洲国产精品成人| 在线亚洲欧美| 久久综合国产精品| 欧美日韩一区二区三| 国产亚洲欧美色| 亚洲精品日日夜夜| 久久精品国产2020观看福利| 免费中文日韩| 国产性天天综合网| 91久久在线| 久久黄色小说| 国产精品久久久久91| 精久久久久久| 亚洲欧美日韩专区| 欧美高清视频在线播放| 国产日韩一区二区| 亚洲精品日韩激情在线电影| 亚洲欧美制服另类日韩| 欧美韩国日本综合| 怡红院精品视频| 亚洲综合不卡| 欧美日韩亚洲成人| 一色屋精品视频在线看| 先锋影院在线亚洲| 欧美精品在线视频观看| 国产在线拍偷自揄拍精品| 亚洲少妇一区| 欧美日韩成人免费| 亚洲国产导航| 久久女同互慰一区二区三区| 国产精品一区二区久久国产| 一区二区高清视频| 欧美日韩亚洲免费| 亚洲三级影院| 欧美aⅴ99久久黑人专区| 国内成人精品2018免费看| 欧美亚洲综合另类| 国产精品一区视频| 亚洲一品av免费观看| 欧美精品福利视频| 136国产福利精品导航网址| 先锋影音一区二区三区| 国产视频观看一区| 久久精品国产精品亚洲| 国内成人在线| 一区二区成人精品| 国产精品久久久久久av福利软件| 一区二区三区欧美| 国产精品vvv| 亚洲欧美激情一区| 国产一区二区三区的电影| 欧美在线免费视屏| 原创国产精品91| 欧美国产日韩亚洲一区| 一区二区三区国产盗摄| 国产精品国产一区二区| 西西裸体人体做爰大胆久久久| 国产日本欧美一区二区三区在线| 欧美中文字幕| 亚洲激情专区| 欧美三级在线视频| 久久国产手机看片| 亚洲国产国产亚洲一二三| 欧美sm视频| 亚洲宅男天堂在线观看无病毒| 国产精品综合视频| 久久综合一区二区| 99视频精品在线| 国产欧美日韩精品专区| 久久久久国色av免费看影院| 亚洲经典在线| 国产乱人伦精品一区二区| 久久婷婷亚洲| 一区二区高清| 国产一区在线免费观看| 欧美精品播放| 久久精品中文字幕一区二区三区| 亚洲激情网站免费观看| 国产精品久久一区二区三区| 久久综合狠狠综合久久激情| 一区二区三区四区蜜桃| 激情综合亚洲| 国产精品热久久久久夜色精品三区 | 欧美gay视频激情| 亚洲免费中文| 亚洲卡通欧美制服中文| 国产精品一级| 欧美日韩国产专区| 免费久久99精品国产自在现线| 亚洲视频综合| 亚洲日本理论电影| 国内精品国产成人| 国产精品家庭影院| 欧美日韩免费观看中文| 久久资源在线| 欧美中文字幕在线播放| 亚洲手机成人高清视频| 在线观看成人网| 国产中文一区| 国产精品欧美风情| 欧美日韩免费区域视频在线观看| 久久婷婷国产综合国色天香| 亚洲欧美不卡| 亚洲一区二区三区在线看 | 欧美日韩国产精品一卡| 久久夜精品va视频免费观看| 亚洲欧美日韩国产综合在线 | 国产精品激情av在线播放| 欧美黄色大片网站| 蜜臀久久久99精品久久久久久| 久久精品99国产精品日本| 午夜在线精品| 欧美一区三区二区在线观看| 亚洲一区二区网站| 亚洲一区二区毛片| 亚洲深夜影院| 欧美亚洲视频在线观看| 午夜久久久久| 欧美一级淫片播放口| 欧美在线观看网址综合| 久久国产精品第一页| 久久国产免费| 亚洲欧美福利一区二区| 亚洲制服欧美中文字幕中文字幕| 一本色道久久综合亚洲精品小说| 99精品免费视频| 亚洲图片在线| 欧美在线观看你懂的| 久久色在线观看| 欧美寡妇偷汉性猛交| 欧美日韩一区二区在线观看视频 | 国产欧美一级| 国语自产在线不卡| 亚洲高清在线观看一区| 亚洲美女性视频| 亚洲网站啪啪| 久久手机免费观看| 欧美日本韩国一区二区三区| 国产精品videosex极品| 黄色一区三区| 亚洲人成网站影音先锋播放| 亚洲免费在线播放| 久久免费偷拍视频| 欧美午夜免费电影| 国产欧美视频一区二区三区| 一区在线视频|