mirror of
https://github.com/picocss/pico.git
synced 2025-04-23 09:56:14 -04:00
Add scripts to build and watch files
This commit is contained in:
parent
2986278b15
commit
8e028956e9
23 changed files with 13439 additions and 1660 deletions
|
@ -11,7 +11,6 @@
|
|||
export const scrollspy = {
|
||||
|
||||
// Config
|
||||
mostVisible: null,
|
||||
minWidth: '992px',
|
||||
interval: 75,
|
||||
targets: {
|
||||
|
@ -22,10 +21,7 @@ export const scrollspy = {
|
|||
|
||||
|
||||
// Init
|
||||
init(mostVisible) {
|
||||
if (this.mostVisible == null) {
|
||||
this.mostVisible = mostVisible;
|
||||
}
|
||||
init() {
|
||||
if (window.matchMedia('(min-width: ' + this.minWidth + ')').matches) {
|
||||
this.setActiveNav();
|
||||
this.scrollStop();
|
||||
|
@ -37,7 +33,7 @@ export const scrollspy = {
|
|||
setActiveNav() {
|
||||
|
||||
// Get active section
|
||||
let currentSection = this.mostVisible(this.targets.sections).getAttribute('id');
|
||||
let currentSection = mostVisible(this.targets.sections).getAttribute('id');
|
||||
|
||||
// Remove all active states
|
||||
let links = document.querySelectorAll(this.targets.nav + ' a.' + this.targets.active);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue