Skip to content

A quick way to dynamically set up elements to be fixed during scroll.

Notifications You must be signed in to change notification settings

yashilanka/makefixed.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#makefixed.js

What's up?

MakeFixed.js is a quick way to dynamically set up elements to be fixed during scroll.

  • Lightweight! Less than 2.4KB;
  • Allow callback functions;
  • jQuery required.

View the demo


Installation

  • Install via Bower bower install --save makefixed
  • Download via GitHub

How to use?

Quick way
$('.fixed').makeFixed();
Custom way

In this example, we have several elements using the class .fixed But we gonna work on a specific element when fixed, id #photo.

$('.fixed').makeFixed
({
	onFixed: function (el)
	{
		if ($(el).attr('id') == 'photo')
		{
			$(el).children().css
			({
				width: '500px'
			});
		}
	},
	onUnFixed: function (el)
	{
		if ($(el).attr('id') == 'photo')
		{
			$(el).children().css
			({
				width: '450px'
			});
		}
	}
});

Help?

Tweet me: @guimadaleno


License

GNU GPL

Enjoy \o

About

A quick way to dynamically set up elements to be fixed during scroll.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published