Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

whats wrong with this

Status
Not open for further replies.

ramblenman

Technical User
Joined
Sep 27, 2003
Messages
14
Location
CA
This is my script, but I cant get it to work, I think I just have some stuff in the wrong place of something done wrong. any help would be apriciated.
Thanks

<HTML>


<HEAD>
<TITLE>slide show 1</TITLE>
<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

var Pic = new Array() ;

Pic[0] = '003.jpg';
Pic[1] = '002.jpg';
Pic[2] = '004.jpg';
Pic[3] = '002.jpg';
Pic[4] = '003.jpg';

);
var whereX = 140;
var whereY = -233;

//Time delay between Slides in milliseconds
var slideShowSpeed = 3000;
var crossFadeDuration = 3;

var nn=(navigator.appName.indexOf("Netscape")!=-1);
var t;var j=0;var p=Pic.length;var preLoad=new Array();
for (i=0;i<p;i++){preLoad=new Image();preLoad.src = Pic;}
function runSlideShow(){
if (document.all){
document.images.SlideShow.style.filter="blendTrans(duration=2)";
document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)";
document.images.SlideShow.filters.blendTrans.Apply();}
if (document.all || document.getElementById){document.images.SlideShow.src = preLoad[j].src;}else{
document.FloatSlideShow.document.images["SlideShow"].src = preLoad[j].src;}
if (document.all){document.images.SlideShow.filters.blendTrans.Play();}
j=j+1;if (j>(p-1))j=0;t=setTimeout('runSlideShow()', slideShowSpeed);}
var dD=document,dH=dD.html,dB=dD.body,px=dD.layers?'':'px';
function floatSS(iX,iY,id){
var L=dD.getElementById?dD.getElementById(id):dD.all?dD.all[id]:dD.layers[id];
this[id+'O']=L;if(dD.layers)L.style=L;L.nX=L.iX=iX;L.nY=L.iY=iY;
L.P=function(x,y){this.style.left=x+px;this.style.top=y+px;};L.Fss=function(){var pX, pY;
pX=(this.iX >=0)?0:nn?innerWidth:nn&&dH.clientWidth?dH.clientWidth:dB.clientWidth;
pY=nn?pageYOffset:nn&&dH.scrollTop?dH.scrollTop:dB.scrollTop;
if(this.iY<0)pY+=nn?innerHeight:nn&&dH.clientHeight?dH.clientHeight:dB.clientHeight;
this.nX+=.1*(pX+this.iX-this.nX);this.nY+=.1*(pY+this.iY-this.nY);this.P(this.nX,this.nY);
setTimeout(this.id+'O.Fss()',33);};return L;}
floatSS(whereX,whereY,'FloatSlideShow').Fss();
</script>

<!-- END FLOATING SLIDE SHOW CODE //-->
}
// End -->
</script>

</HEAD>
<BODY onLoad="runSlideShow()">
<BODY bgcolor="white">
<img border=0 src="001.jpg" name='SlideShow' width=200 height=200></a>
</SCRIPT>

</BODY>
</HTML>
 

For starters, you have 2 body tags, and in the body is a close script tag which has no open script tag.

I'd suggest running your code through an HTML validator and fixing all the errors it throws up.

Hope this helps,
Dan
 

You also have two close script tags in the head section, but only one open tag... and a close A tag next to the IMG in the body, with no open A tag.

As I said - running your code through an HTML validator to get the basic HTML working before attempting to bein with JS is probably the best move.

Hope this helps,
Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top