Niet the Dark Absol
Niet the Dark Absol

Reputation: 324790

background-attachment: local in Firefox?

Is there any way to produce the effect of background-attachment: local in Firefox? For some bizarre reason it doesn't support it...

Upvotes: 2

Views: 789

Answers (2)

Vlad Magdalin
Vlad Magdalin

Reputation: 1690

Firefox added support for background-attachment: local in version 25: http://www.mozilla.org/en-US/firefox/25.0/releasenotes/

Upvotes: 1

BoltClock
BoltClock

Reputation: 724452

You could use JavaScript to set the element's backgroundPosition to correspond to the scroll offset of the element's content whenever it scrolls...

Keep in mind that you have to do this only when the browser doesn't support background-attachment: local, otherwise you'll mess up the scrolling really badly for the ones that do. Alternatively, stick with background-attachment: scroll and just do in JavaScript for all browsers.

Upvotes: 1

Related Questions