rollover's not showing up...?

Discussion in 'Web Design' started by Decibel, Jul 12, 2005.

to remove all ads.
  1. Decibel

    Decibel New Member

    Hi from new member, i'm trying to make a website, i've taught myself everything, but get stuck sometimes and dont know what to do, luckily i found this site.

    Could someone please take a look at my coding and tell me where i'm going wrong, the rollover images just wont show up, they are in the same 'Images' folder alongside the html files.

    my site:

    many thanks
  2. Eclipse

    Eclipse New Member

    I didn't view your source code, do you have two images for your rollovers?

    This is what I use:

    (between your head tags)

    <script type="text/javascript">

    function newImage(arg) {
    if (document.images) {
    rslt = new Image();
    rslt.src = arg;
    return rslt;

    function changeImages() {
    if (document.images && (preloadFlag == true)) {
    for (var i=0; i<changeImages.arguments.length; i+=2) {
    document[changeImages.arguments].src = changeImages.arguments[i+1];

    var preloadFlag = false;
    function preloadImages() {
    if (document.images) {
    home_roll_01_over = newImage("yourimage.gif");
    preloadFlag = true;


    (in your body tag)


    <a href="index.html"
    onmouseover="changeImages('image_off', 'image_on.gif'); return true;"
    onmouseout="changeImages('image_off', 'images_off.gif'); return true;"
    onmousedown="changeImages('image_off', 'images_on.gif'); return true;"
    onmouseup="changeImages('image_off', 'images_on.gif'); return true;">

    Then just repeat for each button/link.
    Hope that helps.

Share This Page