Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Aug 2002
    Location
    Cyberspace
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts

    HELP: Frames not working with rollovers

    <HEAD>
    <SCRIPT>
    <!--
    // Handles rollover images for NN3+ and IE4+
    var loaded = new Array();

    function F_loadRollover(image,imageName) {
    if (image && image.src &&
    (null == image.out || typeof(image.out) == typeof(void(0)))) {
    s = image.src;
    image.out = new Image();
    image.out.src = s;
    image.over = new Image();
    if (imageName.lastIndexOf('/') >= 0 || imageName.lastIndexOf('\\') >=0) {
    s = imageName;
    } else {
    i = s.lastIndexOf('/');
    if (i<0) i = s.lastIndexOf('\\');
    if (i<0) { s = imageName; }
    else { s = s.substring(0,i+1) + imageName; }
    }
    image.over.src = s;
    loaded[image.name] = image;
    }
    }
    function F_roll(imageName,over) {
    if (document.images) {
    if (over) { imageObject = "over"; }
    else { imageObject = "out"; }
    image = loaded[imageName];
    if (image) {
    ref = eval("image."+imageObject);
    if (ref) image.src = eval("image."+imageObject+".src");
    }
    if (window.event)
    window.event.cancelBubble = true;
    }
    }
    //-->
    </SCRIPT>
    </HEAD>

    <A HREF="/pc.html" TARGET="Index" onMouseOver="F_roll('PC',1)"
    onMouseOut="F_roll('PC',0)">
    <IMG NAME="PC" SRC="/pc_off.gif"
    onLoad="F_loadRollover(this,'/pc_on.gif')" BORDER=0
    ALT="PC"></A><BR>

    The above is what I used and it's not working with the rollovers. The left frame is called "Side", and the right frame is called "Index". So I got the windows name right.

    I tried doing it w/o the rollovers, and it worked fine. So I'm sure it's the rollovers causing the problem.

    What can I do to keep the frame and rollovers? I know I can do it w/o frames, but I need the left frame since I'm adding in music on the background. If I do it all in one page, the music will reset each time you log into a different page. And I want to keep the rollovers since they allow me to see a different pic when I highlight the link.

    All help given will be appreciated. Thanks.
    If you want to add me to your ICQ list, mention you're from Coding Forums; otherwise, I will ignore your request to add me.

  • #2
    New Coder
    Join Date
    Aug 2002
    Location
    Cyberspace
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Never mind. I found an alternative, MouseOver. Thanks anyways.

    I got a question, though. What's the different between RollOver and MouseOver? They do the same thing as far as I see it, but why do they have different scripts? There must be something different between them.
    If you want to add me to your ICQ list, mention you're from Coding Forums; otherwise, I will ignore your request to add me.


  •  

    Posting Permissions

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