Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12
  1. #1
    Junior Member
    Join Date
    Feb 2003
    Posts
    19
    Member #
    745
    I'm trying to implement this script to show text when an image is rolled over. It works fine, but I need to use it for mulitple images, each one showing different text. I found a crude way to do it, but it's causing problems with the position of the appearing text. Anyone know the "correct" way to make this work for multiple images and texts?

    <head>
    <SCRIPT LANGUAGE="JAVASCRIPT">
    <!--
    function WLayer(whch){
    if(whch == 1)
    samp = "rollovertext";
    else
    samp = "defaulttext";

    if(document.all){
    document.all["layer1"].innerText = samp;
    }else if(document.layers){
    document.layers["layer2"].document.write(samp);
    document.close();
    }
    }
    //-->
    </SCRIPT>
    </head>

    <body onload="WLayer(0)">
    <div name="layer1" id="layer1">&nbsp;</div>
    <layer name="layer2" id="layer2">&nbsp;</layer>
    </body>

  2.  

  3. #2
    Senior Member splufdaddy's Avatar
    Join Date
    Feb 2003
    Location
    Boston, MA
    Posts
    4,488
    Member #
    735
    Interesting, I've never seen rollovers done by swapping text. Can you show us the page? It may be easier to swap images for images: that way you can make two images that are the same size, and you wont have size issues upon rollover.

  4. #3
    Junior Member
    Join Date
    Feb 2003
    Posts
    19
    Member #
    745
    Yeah, I was initially going to swap images, but I'm trying to keep the load time of the page to a minimum. I don't want to have 4 additional images on their just for this effect.

  5. #4
    Senior Member splufdaddy's Avatar
    Join Date
    Feb 2003
    Location
    Boston, MA
    Posts
    4,488
    Member #
    735
    One trick I've found is to call the preload function at the bottom of my page, after the rest of it is loaded. Depending on the size of your rollover, you may be able to make swap images that are only around 1k each.

    I'm only offering this info cause I dont know how to swap images w/ text while avoiding spacing issues. Chances are Netscape may display the text mouse over differently than IE even if you get it working in IE perfectly. I had some similar spacing issues between IE and NS7 on my last design.

  6. #5
    Junior Member
    Join Date
    Feb 2003
    Posts
    19
    Member #
    745
    Hm. Ok, maybe the image swap does make more sense. Thanks.

  7. #6
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    take a look at my "Design" site (in my signature). I'm doing multiple rollover effects on a cell. Try modifying that and see how it works for ya :-P

  8. #7
    Junior Member
    Join Date
    Feb 2003
    Posts
    19
    Member #
    745
    Hm. I'm not sure what you're referring to. The cascading menus?

  9. #8
    Junior Member
    Join Date
    Feb 2003
    Posts
    19
    Member #
    745
    By the way, I'm interested in those menus. I'm using a setup right now that works great in IE, but I lose the positioning in Netscape, and in older versions, it disappears completely. Not good. How is that menu working out for you?

  10. #9
    Junior Member
    Join Date
    Feb 2003
    Posts
    19
    Member #
    745
    This is the greatest cascading menu setup I've ever seen. You, my friend, are a rock star.

  11. #10
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    LOL, thx... use it all you want :-P

    It's not designed to be easy to set up, but for a web designer it's a great lightweight menu system.


Page 1 of 2 1 2 LastLast

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 11:10 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com