Skip to content

Updated to use CSS classes: A jQuery plugin for creating elements that 'stick' to the top of the window when scrolling down the page

Notifications You must be signed in to change notification settings

hellokingdom/StickyScroll

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 

Repository files navigation

#jQuery StickyScroll

Make elements stick to browser window as you scroll

UPDATE

Stickyscroll performs very badly in the current versions of Chrome and Firefox at the time of this writing, and I'm not sure I'm capable of fixing it without stripping it down to next to nothing. So, development is not very active right now. If you'd like to see an example of the problem stripped down to its most basic case, see the demo-basic.html file. Look at the source in that file and see if you have any ideas to make it work again. It looks to me like the window.onscroll function just doesn't fire enough to make this a viable option anymore.

Fork using CSS classes instead of positioning elements, should fix issues on browsers that support position fixed.

##Usage:

  • $('selector').stickyScroll({ container: .container, offset: 20 })

Adds the following classes to the selected element:

.fixed-top .fixed .fixed-bottom

Example CSS:

  .fixed {
      position:fixed;
      top:20px; // Offset height
	  width:100%;
  }
  .fixed-bottom {
      position:absolute;
	  top:auto;
      bottom:0;
	  width:100%;
  }
  .container {
	  position:relative;	  
  }

About

Updated to use CSS classes: A jQuery plugin for creating elements that 'stick' to the top of the window when scrolling down the page

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%