SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: onmouseover

  1. #1
    SitePoint Member
    Join Date
    Jun 2004
    Location
    Los Angeles
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    onmouseover

    Hello,
    I was wondering if anyone can walk me through the effect I'm trying to use.

    I'm using frontpage 2003 I have two jpgs trying to building a website with photography and I want to do a onmouseover open and onmouseout close. I've seen a lot of the java scripting on the net but can't get any of it to work for me.
    I'm not sure how, where or what to put on the code page to be alble to get the effect I'm looking for.

    Any help would greatly be appreciated.

    vmcuan

  2. #2
    masquerading Nick's Avatar
    Join Date
    Jun 2003
    Location
    East Coast
    Posts
    2,215
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You want to swap the first image with the second image when a person mouses over it, then back again when the mouse leaves?

    Code:
    <script langauge="javascript">
    function swapImage(img) {
       // Path to your image directory
       var imgdir = './images/';
    
       // tag name of your image
       var imgName = 'Logo';
    
       // Assign the image to a variable
       var imgFull = document.getElementById(imgName);
    
       // Change the image
       imgFull.src = img;
      }
    </script>
    Then your img tag should look like this:

    Code:
    <img name="Logo" src="./images/first.jpg" onMouseOver="swapImage('second.jpg');" onMouseOut="swapImage('first.jpg');">
    Obviously, the "first.jpg" and "second.jpg" inside the onMouse events in the img tag should be changed to your image names.
    Nick . all that we see or seem, is but a dream within a dream
    Show someone you care, send them a virtual flower.
    Good deals on men's watches

  3. #3
    SitePoint Wizard
    Join Date
    Jul 2003
    Location
    Kent
    Posts
    1,921
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Doesn't frontpage have an insert/create rollover or interactive image command built into it? Dreamweaver does.

  4. #4
    masquerading Nick's Avatar
    Join Date
    Jun 2003
    Location
    East Coast
    Posts
    2,215
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ah maybe, but it's probably crap
    Nick . all that we see or seem, is but a dream within a dream
    Show someone you care, send them a virtual flower.
    Good deals on men's watches


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
  •