Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Responsive background images – fit one dimension, expand other dimension Reply To: Responsive background images – fit one dimension, expand other dimension

#150257
victorhooi
Participant

Hi,

Aha, for the last issue, I think it was the background-attachment. For some reason, it was being set to fixed. I’ve changed it here:

http://codepen.io/victorhooi/pen/jphsq

Not sure why, since my understanding was that it defaulted to scroll?

https://developer.mozilla.org/en-US/docs/Web/CSS/background-attachment

So, should I attach your jQuery to the onReady and/or the window.onresize?

It’s strange there isn’t some in-built CSS behaviour to take care of this, I would have thought this would be a fairly common requirement.

Cheers,
Victor