Thu Jan 17, 2013 9:46 pm
<html>
<head>
<title>Automatic change to webpage background image </title>
<!--
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js">
</script>
Note you can download the JQuery package instead of using Google version. -->
<script src="jquery-1.8.3.js"></script>
<script>
$(document).ready(function(){
var numberOfImages=3;
var imageNum = Math.round(Math.random()*(numberOfImages-1))+1;
var imgPath=('./'+imageNum+'.jpg');
$('body').css('background-image', ('url("'+imgPath+'")'));
});
</script>
</head>
<body>
<b> Page background image is changed randomly for every page view. </b>
</body>
</html>
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.