Thanks to visit codestin.com
Credit goes to github.com

Skip to content

andreasnymark/merl.scrollToggle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

merl.scrollToggle

View demo

Toggle class of element based on scroll position and viewport.

Default markup

<div class="js-scrollToggle">
	<div class="block">
		<h1>Content</h1>
	</div>
	<div class="block">
		<h1>Content</h1>
	</div>
</div>

Default settings

Key Type Default Note
selector string .js-scrollToggle
selectBlock string .block
classInView string is-inView
classOutView string is-outOfView
toggleAbove boolean false Toggle class when element is above viewport
minWidth number 600 Turn off for smaller devices.

Init

merl.scrollToggle.init();

About

Toggle class on element based on scroll position and viewport.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published