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 7964539
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:54:50+00:00 2026-06-04T05:54:50+00:00

I have two images side-by-side. When the user hovers over an image, it should

  • 0

I have two images side-by-side. When the user hovers over an image, it should expand.

HTML:

<a href="#"><div id="skinny"></div></a>
<a href="#"><div id="room9"></div></a>

jQuery:

$('#skinny').hover(function() {
    $(this).animate({width: '220px'}, 'fast');
    $('#room9').animate({width: '80px'}, 'fast');
}, function() {
    $(this).animate({width:'150px'},'fast');
    $('#room9').animate({width: '150px'}, 'fast');
});

jsFiddle: http://jsfiddle.net/G4q4q/

It “works” with the left image, but I couldn’t get it to work with the right. My current method is inefficient, so if you have any suggestions to optimize it, please let me know.

  • 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-06-04T05:54:51+00:00Added an answer on June 4, 2026 at 5:54 am

    Ok, well I’ve made a very crude example that doesn’t allow for expansion/multiple images, but you should get the idea. To clip elements in CSS, just just overflow: hidden

    jsFiddle: http://jsfiddle.net/G4q4q/10/

    HTML

    <div id="wrap">
        <a href="#" id="skinny">
            <img class="image" src="http://www.theexoticvet.com/images/content_1.jpg" />
        </a>
        <a href="#" id="room9">
            <img class="image" src="http://www.theexoticvet.com/images/content_2.jpg" />
        </a>
    </div>​
    

    CSS

    #wrap {
        position: relative;
        width: 300px;
        height: 300px;
        overflow: hidden;
    }
    
    a {
        display: block;
        float: left;
        top: 0;
        width: 50%;
        height: 300px;
        overflow: hidden;
    }
    

    ​Javascript

    $(function() {
        $('a').hover(function() {
            $(this).stop().animate({width: '80%'}, 'fast')
            $('a').not(this).stop().animate({width: '20%'}, 'fast');
        }, function() {
            $('a').stop().animate({width:'50%'},'fast');
        });
    });
    

    ​
    Edit notes: I edited this to make it a little better than my first attempt.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

On this site: http://walkman.pk/aserdus2/tagok.php I have two background-images on the left and right side,
I have two side borders on my website, left and right side... small image
I have two images in the background of my html doc. One positioned top
Imagine you have two images A and B, and a third grayscale image T.
I want to have two side-by-side areas where I will stream images to, passed
I have a form where the user uploads two images, and based on them
I have two HTML tables which would ideally be placed side by side on
So, I have a DIV full of four HTML buttons that use an image
If I have two images which are both the left side view of a
We have two images with transparent sections that each have a map and separately

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.