Thursday, September 26, 2013

sticky positioning

Per this sticky positioning is of a new kind of CSS position value (like but not like fixed and absolute) which may be called like so:

.sticky {
   position: -webkit-sticky;
   position: -moz-sticky;
   position: -ms-sticky;
   position: -o-sticky;
   top: 15px;
}

 
 

This is a hack for making headers and footers consistently hug the top or base of a visible area on a web page even when one scrolls to another place on the page. The movie here shows off what I mean. You will have seen this trick on smartphone-friendly versions of web sites and not upon "regular" web sites. This is a HTML5 mobile space UX thing. There are also ways to chase this with JavaScript.

No comments:

Post a Comment