PDA

View Full Version : 2 x Javascript's Not Workng



tomyknoker
10-24-2006, 03:28 AM
I have a link to a script and then another script on my html file, when I add both scipts they don't work...
Code:
<script type="text/javascript" src="scripts/mouseover.js"></script>

<script type="text/javascript" >
<!--
var preloads=[];

var objt;
var objb;
var topop=100;
var botop=0;
var speed=75;
var topnum=0;
var botnum=1;
var test=0;

window.onload=function() {
objt=document.getElementById('top');
objb=document.getElementById('bot');
fadeout();
}

function fadeout() {
if(test==0) {
topop--;
botop++;
}
if(objt.filters) {
objt.style.filter='alpha(opacity='+topop+')';
objb.style.filter='alpha(opacity='+botop+')';
}
else {
objt.style.opacity=topop/100;
objb.style.opacity=botop/100;
}
if(topop==0){
topnum+=2;
if(topnum>preloads.length-1){
topnum=0; //if the number of images is odd change this value to 1;
}
objt.src=preloads[topnum].src;
test=1;
}
if(test==1){
topop++;
botop--;
}
if(topop==100){
botnum+=2;
if(botnum>preloads.length-1){
botnum=1; //if the number of images is odd change this value to 0;
}
objb.src=preloads[botnum].src;
test=0;
}
fader=setTimeout('fadeout()',speed);
}


function preload(){

for(i=0;i< arguments.length;i ++) {
preloads[preloads.length]=new Image();
preloads[preloads.length-1].src=arguments[i];
}
}
preload('images/index_image_1.jpg','images/index_image_2.jpg','images/index_image_3.jpg','images/index_image_4.jpg','images/index_image_5.jpg','index_image_6.jpg');

//-->

</script>

tech_support
10-24-2006, 05:17 AM
Sticky