Results 1 to 2 of 2

Thread: 2 x Javascript's Not Workng

  1. #1
    Join Date
    Apr 2006
    Posts
    584
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default 2 x Javascript's Not Workng

    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>

  2. #2
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    Note: Questions regarding multiple script usage are not usually replied to due to their time consuming nature. See this thread for more information, and this tutorial for one possible solution.
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •