From the course: Bootstrap 4 Essential Training
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Use scrollspy - Bootstrap Tutorial
From the course: Bootstrap 4 Essential Training
Use scrollspy
- [Instructor] Scrollspy is a really cool component that allows you to keep track of the scroll of the page and modifies classes according to the position of your elements. So the way that you use it is by creating a data attribute called scroll, and you do that on the container of the element that you want to track the scrolling in. Now that element also needs to have a position of relative, and you also need to target that element with a data target attribute, and then an ID, so we'll be doing this in just a second, so this will all make sense. Data target is usually how we put together what we are doing with the object that we're targeting. So in the case of navigation, I'm going to modify my navigation so that it's fixed to the top of the screen. That's going to cause some issues with the positioning, so I'll show you how to fix that. And then you can use a data offset attribute when you have those issues of positioning. So all this is going to make fantastic sense in just a…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
-
-
(Locked)
Interactive component overview1m 24s
-
(Locked)
Add tooltips7m 21s
-
(Locked)
Display popovers5m 20s
-
(Locked)
Create alerts4m 14s
-
(Locked)
Use dropdowns8m 15s
-
(Locked)
Add collapse accordions12m
-
(Locked)
Use modals12m 3s
-
(Locked)
Build carousels13m 37s
-
(Locked)
Use scrollspy6m 56s
-
(Locked)
Toasts6m 10s
-
(Locked)
Spinners5m 34s
-
(Locked)
Pagination3m 21s
-
(Locked)
Stretched links3m 11s
-
(Locked)
Embeds3m 9s
-
(Locked)
-