Re: Alternative to Sticky Positioning

Am 07.11.2012 16:19 schrieb Rudolph Gottesheim:
> I've got an alternative idea for the problem that Sticky Positioning[1]
> is trying to solve. I think it can potentially solve more use cases than
> just this one.
>
> What if we had a pseudo-class that matched elements based on whether
> they are inside the viewport or not? Then you could give the element a
> position: fixed when it is not. Like this:
>
> [role=navigation]:viewport-partially-hidden {
>      position: fixed;
>      top: 0;
>      left: 0;
> }

Wouldn't this jump unexpectedly when being scrolled out of the viewport? 
(Except it was originally positioned at top:0 and left:0 - but in this 
case position:fixed would be sufficient anyway.)

Received on Wednesday, 7 November 2012 16:07:13 UTC