Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Slide Show Script
03-08-2010, 10:17 AM
Post: #1
Video Slide Show Script
Hello everyone,

this script is for having a slide show in your websites.
here it goes,


Code:
<html>
<head>
<SCRIPT LANGUAGE="JavaScript">
theimage = new Array();

theimage[0]=["PHOTO NAME", "FILENAME.JPG"];
theimage[1]=["PHOTO NAME", "FILENAME.GIF"];
theimage[2]=["PHOTO NAME", "FILENAME.JPG"];

playspeed=3000;
dotrans=1;  
transtype='blendTrans';  
transattributes='duration=1,transition=23';  
randomorder=1;
playdiffernce=500;  
autostart=0;
preloadslides=1;
function makeRandom() {
tempimage = new Array();
for(p=0;p<theimage.length;p++){
for(p1=0;p1>-1;p1) {tempNum = Math.floor(Math.random()*theimage.length)
if(!tempimage[tempNum]){tempimage[tempNum]=theimage[p];break}}}
for(p=0;p<theimage.length;p++)theimage[p]=tempimage[p]}
if(randomorder==1)makeRandom()

function preloadSlide() {for(k=0;k<til;k++) {theimage[k][1]=new Image().src=theimage[k][1];}}

window.onload=function(){
if(window.preloadslides)preloadSlide();if(window.autostart)slidePlay();}

window.onresize=function(){
if(document.layers)this.location=this.location;}
</SCRIPT>
</head>
<body>

<FORM NAME="slideshow">
<DIV ALIGN="CENTER">
<TABLE border=0 CELLPADDING=0 CELLSPACING=0 BGCOLOR="black">
<TR>
<TD ALIGN=CENTER>
<div align="center">
  <center>
<TABLE border=0 CELLPADDING=10 CELLSPACING=1 style="border: 1 solid #008080">
<TR>
    <TD ALIGN=CENTER BGCOLOR="#0099CC" colspan="5" style="border: 1 solid #000000"><font
      face="Verdana,Arial,Helvetica" size="2"><b>My Photo
      Slideshow</b></font></TD>
</TR>
<TR>
    <TD ALIGN=CENTER BGCOLOR="#FFFFFF" colspan="5" width="250" height="270" style="border: 1 solid #000000"><A HREF="#" onmouseover="this.href=theimage[i][2];return false"><SCRIPT>document.write('<IMG NAME="slideimage"  STYLE="filter:'+transtype+'('+transattributes+');" SRC="'+theimage[0][1]+'" BORDER=0>')</SCRIPT></A></TD>
</TR>
<TR>
    <TD ALIGN=CENTER BGCOLOR="#0099CC" colspan="5" style="border: 1 solid #000000"><SELECT NAME="theimages" onchange="slideImage(document.slideshow.theimages.selectedIndex);" style="background-color: #0099CC; color: #000000; font-family: Verdana, Arial, Helvetica; font-size: 10pt; font-weight: bold; border: 1 solid #000000" size="1"></SELECT><SCRIPT>
for (y=0;y<theimage.length;y++) {document.slideshow.theimages[y]=new Option(theimage[y][0])}</SCRIPT>
    </TD>
</TR>
<TR>
    <TD ALIGN=CENTER BGCOLOR="#0099CC" style="border: 1 solid #000000"><b><font
      color="#000000"><a
      HREF="javascript:slideImage(0);" onfocus="this.blur()"><font
      face="Verdana,Arial,Helvetica" size="2" color="#000000">&lt;&lt;</font></a><font
      face="Verdana,Arial,Helvetica" size="2" color="#000000"><SCRIPT>imgStop=new Image().src='../beta/slideshow/b4.jpg';</SCRIPT></font></font></b></TD>
    <TD ALIGN=CENTER BGCOLOR="#0099CC" style="border: 1 solid #000000"><a
      href="javascript:slideImage(0);"><b><font face="Verdana,Arial,Helvetica"
      size="2" color="#000000">&lt;</font></b></a></TD>
    <TD ALIGN=CENTER BGCOLOR="#0099CC" style="border: 1 solid #000000"><a
      href="javascript:slidePlay();"><b><font face="Verdana,Arial,Helvetica"
      size="2" color="#000000">Play/Stop</font></b></a></TD>
    <TD ALIGN=CENTER BGCOLOR="#0099CC" style="border: 1 solid #000000"><a
      href="javascript:slideImage(i+1);"><b><font face="Verdana,Arial,Helvetica"
      size="2" color="#000000">&gt;</font></b></a></TD>
    <TD ALIGN=CENTER BGCOLOR="#0099CC" style="border: 1 solid #000000"><a
      HREF="javascript:slideImage(theimage.length-1);" onfocus="this.blur()"><b><font
      face="Verdana,Arial,Helvetica" size="2" color="#000000">&gt;&gt;</font></b></a></TD>
</TR>
</TABLE>
  </center>
</div>
</TD>
</TR>
</TABLE>
</FORM>

<SCRIPT>
with(document){i=0,play=0,di=images,dl=links,form=slideshow,til=theimage.length}

function slideImage(num) {
i=num%til;if(i<0)i=til-1;
if(document.all&&dotrans==1)eval('di.slideimage.filters.'+transtype+'.apply()')
di.slideimage.src=theimage[i][1];
if(document.all&&dotrans==1)eval('di.slideimage.filters.'+transtype+'.play()')
if(form.theimages)form.theimages.selectedIndex = i;
if(form.slidebox)form.slidebox.value = theimage[i][0];
if(form.slidecount)form.slidecount.value = "Image "+(i+1)+" of "+til;
if(form.slidespeed)doSpeed(0);}

function slidePlay() {
if (!window.playing) {
slidePlaying(i+1);
if(form.play)form.play.value="   Stop   ";}
else {playing=clearTimeout(playing);
if(form.play)form.play.value="   Play   ";}
if(di.imgPlay){setTimeout('di.imgPlay.src="'+imgStop+'"',1);imgStop=di.imgPlay.src}}

function slidePlaying(num) {
playing=setTimeout('slidePlaying(i+1);slideImage(i+1);', playspeed);}

slideImage(0);
</SCRIPT>
</body>
</html>
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: