PDA

View Full Version : background slideshow (left to right)



sumcwan
07-27-2008, 01:28 AM
below is a background slideshow I found, but how could I make it slide from left to right instead of fading in/out?


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>

<style>
body{
/*Remove below line to make bgimage NOT fixed*/
background-attachment:fixed;
background-repeat: no-repeat;
/*Use center center in place of 300 200 to center bg image*/
background-position: 300 200;
}
</style>

<script language="JavaScript1.2">

//Background Image Slideshow- Dynamic Drive (www.dynamicdrive.com)
//For full source code, 100's more DHTML scripts, and TOS,
//visit http://www.dynamicdrive.com

//Specify background images to slide
var bgslides=new Array()
bgslides[0]=["01.jpg", "01.html", "_self"]
bgslides[1]=["02.jpg", "02.html", "_self"]
bgslides[2]=["03.jpg", "03.html", "_self"]
bgslides[3]=["04.jpg", "04.html", "_self"]


//Specify interval between slide (in miliseconds)
var speed=4000

//preload images
var processed=new Array()
for (i=0;i<bgslides.length;i++){
processed[i]=new Image()
processed[i].src=bgslides[i]
}

var inc=-1

function slideback(){
if (inc<bgslides.length-1)
inc++
else
inc=0
document.body.background=processed[inc].src
}

if (document.all||document.getElementById)
window.onload=new Function('setInterval("slideback()",speed)')

</script>


</head>

<body>
</body>
</html>

sandyk3
07-27-2008, 04:12 AM
If you look at all of the slide shows here at Dynamicdrive you will find what you are looking for.
Sandy K

sumcwan
07-27-2008, 06:42 AM
ya, I found one that moves from left to right, and one for background slideshow, but I have trouble combine them together. I hope someone could help me with that, thanks.