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 9:08 am
#150317
georgearnall
Participant
If you are already have a JS file that will run, you can just include that snippet somewhere and it will work. To make it update when people resize and on document ready, use this:
$(function() {
$('section').css('height', innerHeight);
$(window).resize(function() {
$('section').css('height', innerHeight);
});
});