SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    will code HTML for food Michel V's Avatar
    Join Date
    Sep 2000
    Location
    Corsica
    Posts
    552
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just wondering if thatwas possible, can i make a mouse-over effect on an image, so that a little text appears in lieu of the image ?

    I suppose it must be a Javascript effect, anyone has a clue ?
    [blogger: zengun] [blogware contributor: wordpress]

  2. #2
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    An easy way to accomplish this would be to make the text an image, then you just do a swap image effect. You can use this code if you like.


    <script language="javascript">
    <!--

    if (document.images) {

    calendar_on = new Image();
    calendar_on.src = "images/calendar_on.gif";
    calendar_off = new Image();
    calendar_off.src = "images/calendar_off.gif";

    }

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

    // -->
    </script>


    call it like this:

    <a href="calendar.shtml" onmouseover="changeImages('calendar', 'calendar_on')" onmouseout="changeImages('calendar', 'calendar_off')"><img name="calendar" src="images/calendar_off.gif" alt="Community Calendar" width="133" height="18" border="0"></a>
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  3. #3
    I believe you have my stapler. scrubz's Avatar
    Join Date
    Feb 2001
    Location
    Van down by the river
    Posts
    254
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I agree that the text image is easiest.

    I've got a version that swaps an image for regular text, and it nearly works except that Netscape 4.7 doesn't like to return to the image after viewing the text. Trying to find a fix, though (it's a slow day at work).


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
  •