www.webdeveloper.com
Results 1 to 5 of 5

Thread: Help me with this rollover

  1. #1
    Join Date
    Apr 2005
    Location
    Leonardtown MD
    Posts
    31

    Question Help me with this rollover

    I am trying to get this rollover with fade to work. I forget exactly where I copied the javascript from but it worked before I modifed it. Can anyone help me troubleshot this problem?
    Thanks

    Here is the code I have so far:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/transitional.dtd">

    <html>

    <head>

    <title> Welcome to Howling Wolf Studios </title>

    <HEAD>

    <SCRIPT LANGUAGE="JavaScript">

    <!-- This script and many more are available free online at -->
    <!-- The JavaScript Source!! http://javascript.internet.com -->

    <!-- Begin
    var maximages = 10; // how many fade images do you have?
    var fadespeed = 125; // fade frame time in milliseconds; 125 = 125 ms

    var fadeintimer;
    var fadeouttimer;
    var fadeincount = 0;
    var fadeoutcount = maximages-1;
    var fadearray = new Array(maximages); // enter all the fade images here
    // the first item should be 0, then numbered through 1 less than your maximages

    fadearray[0] = "images/NewWolfLogo.jpg";
    fadearray[1] = "images/NewWolfLogoFade00.jpg";
    fadearray[2] = "images/NewWolfLogoFade01.jpg";
    fadearray[3] = "images/NewWolfLogoFade02.jpg";
    fadearray[4] = "images/NewWolfLogoFade03.jpg";
    fadearray[5] = "images/NewWolfLogoFade04.jpg";
    fadearray[6] = "images/NewWolfLogoFade05.jpg";
    fadearray[7] = "images/NewWolfLogoFade06.jpg";
    fadearray[8] = "images/NewWolfLogoFade07.jpg";
    fadearray[9] = "images/NewWolfLogoFade08.jpg";
    fadearray[10] = "images/NewWolfLogoFade09.jpg";


    for (var i = 0; i < maximages; i++) {
    eval('pic' + i + ' = new Image();');
    eval('pic' + i + '.src = fadearray[i];'); // preloads fade images
    }
    function fade_in() {
    clearTimeout(fadeouttimer);
    document.images['fade-pic'].src = fadearray[fadeincount];
    if (fadeincount != maximages-1) {
    fadeincount++;
    fadeintimer = setTimeout('fade_in()', fadespeed);
    }
    else {
    clearTimeout(fadeintimer);
    fadeincount = 0;
    }
    }
    function fade_out() {
    clearTimeout(fadeintimer);
    document.images['fade-pic'].src = fadearray[fadeoutcount];
    if (fadeoutcount != 0) {
    fadeoutcount--;
    fadeouttimer = setTimeout('fade_out()', fadespeed);
    }
    else {
    clearTimeout(fadeouttimer);
    fadeoutcount = maximages-1;
    }
    }
    // End -->
    </script>

    </head>
    <body>
    <body bgcolor="#000000" text="FF0000">
    <font face= "Arial"size="+5">
    <b>
    <i>
    <div align="center"
    Welcome to Howling Wolf Studios
    </font>
    </div>
    <br>
    </b> </i>

    <center>
    <a href="mailto:jbock@howlingwolfstudios.net" onmouseover="fade_in()" onmouseout="fade_out()">
    <img src="images/NewWolfLogo.jpg" border=0><br>
    <img name="HWSLogo" height=457 width=445 border=0 src="images/NewWolfLogo.jpg"><br>
    <img src="images/NewWolfLogoFade09.jpg" border=0><br></a>

    </center>

    <p><center>
    <font face="arial, helvetica" size="-2">Free JavaScripts provided<br>
    by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
    </center><p>

    </body>
    </html>
    "Time is like a flowing river...history repeats itself:
    From Secret of Mana SNES

  2. #2
    Join Date
    Jul 2004
    Location
    Canada, eh
    Posts
    784
    you don't seem to have an image with id="fade-pic" anywhere, so the code is unable to find document.images["fade-pic"]
    Kids, kids... you tried your best, and you failed miserably; the lesson is: never try.

  3. #3
    Join Date
    Apr 2005
    Location
    Leonardtown MD
    Posts
    31
    So I would just need to rename the image "fade-pic" to my first image or my last image?
    Thanks Again
    "Time is like a flowing river...history repeats itself:
    From Secret of Mana SNES

  4. #4
    Join Date
    Jul 2004
    Location
    Canada, eh
    Posts
    784
    well, whichever img tag you want to change should have the name/id "fade-pic"
    Kids, kids... you tried your best, and you failed miserably; the lesson is: never try.

  5. #5
    Join Date
    Apr 2005
    Location
    Leonardtown MD
    Posts
    31

    Question Ok another Question

    Ok I have gotten the rollover to work. But it is showing the first and the last image in addition to the image with the rollover. Here is the code.
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/transitional.dtd">

    <html> <!-- Frames the HTML Page -->

    <head> <!-- Title Open Command -->

    <title> Welcome to Howling Wolf Studios </title> <!-- Title at top of browser -->

    <HEAD>

    <SCRIPT LANGUAGE="JavaScript">

    <!-- This script and many more are available free online at -->
    <!-- The JavaScript Source!! http://javascript.internet.com -->

    <!-- Begin
    var maximages = 11; // how many fade images do you have?
    var fadespeed = 125; // fade frame time in milliseconds; 125 = 125 ms

    var fadeintimer;
    var fadeouttimer;
    var fadeincount = 0;
    var fadeoutcount = maximages-1;
    var fadearray = new Array(maximages); // enter all the fade images here
    // the first item should be 0, then numbered through 1 less than your maximages

    fadearray[0] = "images/NewWolfLogo.jpg";
    fadearray[1] = "images/NewWolfLogoFade00.jpg";
    fadearray[2] = "images/NewWolfLogoFade01.jpg";
    fadearray[3] = "images/NewWolfLogoFade02.jpg";
    fadearray[4] = "images/NewWolfLogoFade03.jpg";
    fadearray[5] = "images/NewWolfLogoFade04.jpg";
    fadearray[6] = "images/NewWolfLogoFade05.jpg";
    fadearray[7] = "images/NewWolfLogoFade06.jpg";
    fadearray[8] = "images/NewWolfLogoFade07.jpg";
    fadearray[9] = "images/NewWolfLogoFade08.jpg";
    fadearray[10] = "images/NewWolfLogoFade09.jpg";


    for (var i = 0; i < maximages; i++) {
    eval('pic' + i + ' = new Image();');
    eval('pic' + i + '.src = fadearray[i];'); // preloads fade images
    }
    function fade_in() {
    clearTimeout(fadeouttimer);
    document.images['HWSLogo'].src = fadearray[fadeincount];
    if (fadeincount != maximages-1) {
    fadeincount++;
    fadeintimer = setTimeout('fade_in()', fadespeed);
    }
    else {
    clearTimeout(fadeintimer);
    fadeincount = 0;
    }
    }
    function fade_out() {
    clearTimeout(fadeintimer);
    document.images['HWSLogo'].src = fadearray[fadeoutcount];
    if (fadeoutcount != 0) {
    fadeoutcount--;
    fadeouttimer = setTimeout('fade_out()', fadespeed);
    }
    else {
    clearTimeout(fadeouttimer);
    fadeoutcount = maximages-1;
    }
    }
    // End -->
    </script>

    </head> <!-- Title Close Command -->

    <body> <!-- Frames the content of the page -->

    <body bgcolor="#000000" text="FF0000"> <!-- Background color and text color -->

    <font face= "Arial"size="+5"> <!-- Text Formatting -->

    <b>
    <i>
    <div align="center" <!-- Alignment to center -->

    Welcome to Howling Wolf Studios

    </font>

    </div>

    <br>
    <center>
    <a href="mailto:jbock@howlingwolfstudios.net" onmouseover="fade_in()" onmouseout="fade_out()">

    <img name="HWSLogo" height=457 width=445 border=0 src="images/NewWolfLogo.jpg"><br>


    </center>

    <p><center>
    <font face="arial, helvetica" size="-2">Free JavaScripts provided<br>
    by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
    </center><p>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>

    <br>
    <br>
    </font>

    <font face= "Arial"size="+1"> <!-- Text Formatting -->

    This is my group project called Deadfall done in Alias' Maya. The assignment was to design a 30 second animation that flies around the capture the flag level we designed and built. I worked on everything on the red base minus the three gun turrents. To download the file right mouse click and hit "save target as".
    <br>
    <br>
    <a href="images/deadfall.mov"><font size="+1" color="#FFFFFF"> <u> Click here to download Deadfall.</u></font></a>
    <br>
    <br>
    This is my first project done in my Interactive Design Class. The assignment was to make an animation from the Shockwave Rider excerpt, which you can <A HREF="html/Shockwave.html "font size="+1" color="#FFFFFF" target="_blank" ><font size="+1" color="#FFFFFF"><u> read here</u></font></a>. To download the file right mouse click and hit "save target as".
    <br>
    <br>
    <a href="images/Shockwave.mov"><font size="+1" color="#FFFFFF"><u> Click here to download the Shockwave Rider.</u></font></a>
    <br>
    <font face= "Arial"size="+1"> <!-- Text Formatting -->
    <br>
    Don't have Quicktime?
    <a href="http://www.apple.com/quicktime/download/index.html"target="_blank"> <font size="+1" color="#FFFFFF" ><u>
    <br>
    Download it here.</u></a>
    <br>
    <a href="http://www.apple.com/quicktime/download/index.html"><img src="images/getquicktime.gif" hspace="15" vspace="15" border="0" ></u></font></a>

    <br>
    <br>



    <A HREF="mailto:jbock@howlingwolfstudios.net"> <font size="+1" color="#FFFFFF"><u> Contact Me</A>
    <!-- Text Formatting -->
    </i>
    </font>

    </body>

    </html>
    "Time is like a flowing river...history repeats itself:
    From Secret of Mana SNES

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles