Home › Forums › JavaScript › Responsive background images – fit one dimension, expand other dimension › Reply To: Responsive background images – fit one dimension, expand other dimension
September 17, 2013 at 3:54 am
#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