LeighJor
asked on
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 .
<script type="text/javascript">
var totalCount = 5;
function ChangeIt()
{
var num = Math.ceil( Math.random() * totalCount );
document.body.background = 'bgimages/'+num+'.jpg';
document.body.style.backgr oundSize = '100% 100%';
document.body.style.backgr oundRepeat = "no-repeat";
document.body.style.backgr oundAttach ment="fixe d";
// Background repeat
}
</script>
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 .
<script type="text/javascript">
var totalCount = 5;
function ChangeIt()
{
var num = Math.ceil( Math.random() * totalCount );
document.body.background = 'bgimages/'+num+'.jpg';
document.body.style.backgr
document.body.style.backgr
document.body.style.backgr
// Background repeat
}
</script>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.