Background image slideshow javascript source code

Here is the code for background image slideshow using javascript and css.

check out the code

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Language" content="en-us">
<style>
body{
background-repeat: no-repeat;
background-position: 50 50;
}
</style>
<script >
//Specify background images to slide
var imgs=new Array()
imgs[0]="img1.jpg";
imgs[1]="img2.jpg";
imgs[2]="img3.jpg";
//Specify interval between slide (in miliseconds)
var speed=2000
//preload images
var processed=new Array()
for (i=0;i<imgs.length;i++){
processed[i]=new Image();
processed[i].src=imgs[i];
}
var inc=-1;
function slideimg(){
if (inc<imgs.length-1)
inc++;
else
inc=0;
document.body.background=processed[inc].src;
}
if (document.all||document.getElementById)
window.onload=new Function('setInterval("slideimg()",speed)');
</script>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%" id="table1" height="381">
	<tr>
		<td>
			<p>This is just dummy text</p>
			<p>This is just dummy text</p>
			<p>This is just dummy text</p>
			<p>This is just dummy text</p>
		</td>
	</tr>
</table>
</body>
</html>

You can use it for any elements background.

hope it will be useful.
thanx n regards,
Nikhil Ughade
Web Designer
[Pune]

Image reflection or mirror effect

download source code (click here) or image reflection effect

javascript transition effect

<!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” xml:lang=”en” lang=”en”>
<head>
<title>
transition effect
</title>
<script type=”text/javascript” xml:space=”preserve”>
//<![CDATA[
var transitionName =
[“Box In”, “Box Out”,
“Circle In”, “Circle Out”,
“Wipe Up”, “Wipe Down”];

var counter = 0;
var whichImage = true;

function blend()
{
if (whichImage) {
image1.filters( “revealTrans” ).apply();
image1.style.visibility = “hidden”;
image1.filters( “revealTrans” ).play();
}
else {
image2.filters( “revealTrans” ).apply();
image2.style.visibility = “hidden”;
image2.filters( “revealTrans” ).play();
}
}

function reBlend( fromImage )
{
counter++;

if (fromImage) {
image1.style.zIndex -= 2;
image1.style.visibility = “visible”;
image2.filters( “revealTrans” ).transition = counter % 6;
}
else {
image1.style.zIndex += 2;
image2.style.visibility = “visible”;
image1.filters( “revealTrans” ).transition = counter % 6;
}

whichImage = !whichImage;
blend();
transitionDisplay.innerHTML = “Transition ” +
counter % 6 + “: ” + transitionName[ counter % 6 ];
}
//]]>
</script>
</head>
<body onload=”blend();”>
<img id=”image2″ src=”https://designikx.files.wordpress.com/2010/01/zindex2.jpg
style=”position: absolute; left: 10px; top: 10px; width: 246px;
z-index:1; visiblity: visible; filter: revealTrans(duration=2, transition=0)”
onfilterchange=”reBlend( false )” alt=”” name=”image2″ />
<img id=”image1″ src=”https://designikx.files.wordpress.com/2010/01/zindex1.jpg
style=”position: absolute; left: 10px; top: 10px; width: 246px;
z-index:1; visiblity: visible; filter: revealTrans(duration=2, transition=0)”
onfilterchange=”reBlend( true )” alt=”” name=”image1″ />

<div id=”transitionDisplay” style=”position: absolute; top: 70px; left: 80px;”>
play it
</div>
</body>
</html>

 

as we use here the inbuilt functions of IE ..it only works on IE. So if any one knows how to remove this drawback …plz let me know.
Thanks

——————————————-
Like this Page on Facebook : – https://www.facebook.com/littlewelt

javascript fade in / out effect

This is image only :

click here to download sourc code (doc format)
——————————————-
Like this Page on Facebook : – https://www.facebook.com/littlewelt

Draggable div using javascript

Draggable div using javascript

draggable-div

Draggable DIV using javascript

download source code from here draggable div

%d bloggers like this: