Brad Fitzpatrick (brad) wrote,
Brad Fitzpatrick
brad

background-attachment: parallax

CSS defines background-attachment which can be scroll or fixed.

I want:
BODY {
  background-image: url(something.jpg);
  background-attachment: parallax;
  background-parallax-ratio: 0.5;
}
(I want my background image to scroll at some ratio of the speed of the text.)

I bet this could be accomplished with some DHTML ... connect document.onScroll to some code which modifies the repeated background vertical offset to (vert_scroll * ratio % image_height) or something.

Somebody make this for me and I'll buy you a present. I have no practical use for it, but I want to see it....

I thought I found it, but this doesn't seem to be it:

http://www.geekcomix.com/snh/files/demos/css-trans/window.html

It doesn't work in Mozilla or IE, nor is it what I want, even if it did work.
Subscribe
  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 4 comments