![]() |
Randomized background on refresh
Hi there,
I'm currently using a javascript for randomized background image on page refresh however, I need the background image to be full screen and resizable on browser resize. I'm using this script as below: <script type="text/javascript"> var totalCount = 8; function ChangeIt() { var num = Math.ceil( Math.random() * totalCount ); document.body.background = 'bgimages/'+num+'.jpg'; document.body.style.backgroundRepeat = "repeat";// Background repeat } </script> What do I have to add in document.write any ideas? I would also need it to work across all browsers and mobile platform. If this doesn't work any Jquery or HTML5 tutorials on this? Please help! Thanks much :) |
I don't have the link to it, now, but there is a library that you can use to make the background image full size and scalable with browser size changes.
|
Quote:
|
I think this is it. It's been a while. It does require jQuery.
http://srobbin.com/jquery-plugins/backstretch/ |
| All times are GMT +1. The time now is 02:28 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.