How to make background image responsive for ipad phone ie
I am using the script below to for random background images.
I am also using a css class which successfully make normal (non-background images) responsive.
I want to know a way to make the random background images responsive to display size eg IE, ipad, smartphone. At moment they cover smaller display but distorted and IE shows up as fixed in left top.
Thanks in advance and anticipation .
var totalCount = 5;
var num = Math.ceil( Math.random() * totalCount );
document.body.background = 'bgimages/'+num+'.jpg';
document.body.style.backgroundSize = '100% 100%';
document.body.style.backgroundRepeat = "no-repeat";
// Background repeat