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.

Results 1 to 2 of 2
  1. #1
    Junior Member
    Join Date
    Oct 2005
    Posts
    1
    Member #
    11744
    In my site I'm creating with css, I am looking to have changing images. I have a few images in one location that are part of an imagemap that people will 'mouseover'. When the mouse is hovering over the image, I want an image in another location to change depending on which image they hover their mouse over. How do I set this up? Im thinking that I have to add some OnMouseOver code into the imagemap area after the coordinates but I'm not exactly sure how to do it. Is this right? Also, I have a caption near the image I want to change. I need the caption to also change according to each picture. Thanks.

    edit: I think I've gotten the image to work properly. I just need the text to work. Ive got a div tag set up where I want my text to be located but I don't know how to add text there with a mouseover. Any ideas?

  2.  

  3. #2
    Senior Member
    Join Date
    May 2003
    Location
    UK
    Posts
    2,354
    Member #
    1326
    To display text in a div..

    Step 1: give it an id
    HTML Code:
    <div id="something">&nbsp;</div>
    Step 2: create the event that triggers the event..
    HTML Code:
     onMouseOver="changeText( 'something' );" />
    For step 2 I am unsure of what element you want that code on, perhaps a image? If so, when that image is mouse overed the function will be called.
    Step 3: The function..
    Code:
    <script type="text/javascript">
    
    function changeText(elem_id) 
        {
              document.getElementById(elem_id).innerHTML = 'enter your text here';
    
        }
    
    </script>


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 06:41 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com