3.0.1 • Published 4 years ago

@borngroup/born-fixit v3.0.1

Weekly downloads
193
License
ISC
Repository
github
Last release
4 years ago

BORN FixIt

Sets elements to 'position: fixed;' after window has scrolled to the 'target' element. Allows to set boundaries and other options.

Options and Callbacks

target: HTMLElement Target HTML Element to make sticky.

offset: Integer | Selector | HTMLElement Default: 0. Offset value or element referebce to set the target element as 'sticky', from top. Added as pixels.

useOffsetOnTarget: Boolean Default: false. adds the offset value as position 'top: value;'.

respondToParent: Boolean | HTMLElement Default: false. If 'target' element is not meant to be full width, make it use the width of it's closest parent. Alternatively, pass an HTMLElement to use instead of the closest parent.

containedInParent: boolean | HTMLElement Default: false. If an HTMLElement is provided, use that as the boundaries for the 'sticky' element. Set to TRUE to use closest parent, relative to the 'target' element.

enabled: function Runs once before initiallizing the module. If false is returned, the module will not initialiize.

Usage

var myFixedElement = new FixIt({
	target: document.querySelector('.my-sticky-element'),
	offset: 50,
	enabled: function() {   
	            //Do something
	            if (myCondition) {
	                return true;
	            }
	            return false;
	         },
});
3.0.1

4 years ago

3.0.0

4 years ago

2.5.0

5 years ago

2.5.1

5 years ago

2.4.1

5 years ago

2.4.0

5 years ago

2.3.3

5 years ago

2.3.2

5 years ago

2.3.0

5 years ago

2.3.1

5 years ago

2.2.3

5 years ago

2.2.4

5 years ago

2.2.2

5 years ago

2.2.1

6 years ago

2.2.0

7 years ago

2.1.0

7 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.1.11

7 years ago

1.1.10

7 years ago

1.1.9

7 years ago

1.1.8

8 years ago

1.1.6

8 years ago

1.1.5

8 years ago

1.1.4

8 years ago

1.1.3

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago