Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6893623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:40:55+00:00 2026-05-27T06:40:55+00:00

Here is the Situation. I am creating a digital gift guide, like a digital

  • 0

Here is the Situation.

I am creating a digital gift guide, like a digital ad insert in the Sunday paper. I am creating a footer that has three gift card type images, that on rollover need to image swap. The problem is the image the designer has given me for the rollover has some extra height and width due to sparkles she has added to the edges. She also sent me the rollover image with a 7 degree tilt. So the dimensions in pixels of the original image are w=156 h=96, and the rollover image is w=206 h=154 (due to tilt and extras added)

I decided to swap images using javascript, but I am fairly new at it, and it may not be right, but it is doing the job. The problem is the images are swapping, but the new image is shrinking to fit in the space of the original image. What is the best way to do this simple image swap?

<a href="" onMouseOver="document.MyImage.src='img/Free-Gift(Roll).png';" onMouseOut="document.MyImage.src='img/Free-Gift.jpg';">
<img src="img/Free-Gift.jpg" name="MyImage" class="free">

</a> 

.free {
    width: 156px;
    height: 96px;
    position: absolute;
    top: 55px;
    left: 352px;
}

.freeroll {
    position: absolute;
    width: 206px;
    height: 156px;

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T06:40:55+00:00Added an answer on May 27, 2026 at 6:40 am

    You’re forgetting to set the class:

    <a href="" onMouseOver="document.MyImage.src='img/Free-Gift(Roll).png';document.MyImage.className='freeroll';" onMouseOut="document.MyImage.src='img/Free-Gift.jpg';document.MyImage.className='free';">
        <img src="img/Free-Gift.jpg" name="MyImage" class="free" />
    </a>
    

    However… there is a better way to do this, using only CSS:

    <a href="" id="myRollover">Free Gift!</a>
    
    ...
    
    #myRollover {
         background-image: url('img/Free-Gift.jpg');
         width: 156px;
         height: 96px;
         position: absolute;
         top: 55px;
         left: 352px;
         text-indent: -9999px;
    }
    
    #myRollover:hover {
         background-image: url('img/Free-Gift(Roll).jpg');
         width: 206px;
         height: 156px;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

the situation is like this: im creating a Logger class that can write to
Here is my situation: Im creating a widget that site admins can embed in
Here's the lowdown of the situation. I am creating a role-playing game with PHP.
Here's the situation - I've got a shell that loads an external .swf. Now,
Here is my situation. I'm creating a drawing application using OpenGL and WinAPI. My
So, here's the situation: I have a parent buildfile that defines a compilation task,
Here is my situation: I have an application that use a configuration file. The
Here's my situation: We have an outside provider that will be pushing XML files
I have a situation where I'm creating a number of IDisposable objects that encapsulate
I'm creating (really, re-creating) an app that has existing user and other data in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.