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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:48:25+00:00 2026-05-23T09:48:25+00:00

I try to do a image gallery with a simple zoom effect, but i

  • 0

I try to do a image gallery with a simple zoom effect, but i just get a hover effect every second element. any suggestions would be great.

here is the css:

ul{
    margin: 140px 0 0 140px;
    list-style-type: none;
}
li{
    width: 84px;
    height: 84px;
    border: 1px solid #ccc;
    float: left;
    margin: 2px;
    padding: 0;
    background-color: #efefef;
}
.item_resized{
    width: 170px;
    height: 170px;
    border: 1px solid #ccc; 
    z-index: 2;
    position: relative;
    margin-left: -43px;
    margin-top: -43px;
    background-color: #f0f0f0;
}

the html:

<ul class="imgGallery">
    <li>1</li>
    <li>2</li>
    <li>3</li>
    <li>4</li>
</ul>

and jquery:

jQuery(document).ready(function() {
    $('.imgGallery').find('li').each(function() {   
        $(this).hover(function() {                                              
            /* Add Img-Container */
            $(this).prepend('<div class="item_resized"></div>');
        },function() {
            /* Remove Img-Container */
            $(this).find('.item_resized').remove(); 
        });
    });
});

as you can see, the li-element 2 and 4 is not affected by the hover effect.

thanks!

danny

  • 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-23T09:48:26+00:00Added an answer on May 23, 2026 at 9:48 am

    Try this

    jQuery(document).ready(function() {
        $('.imgGallery').delegate('li', 'mouseover',function() {   
                /* Add Img-Container */
                $(this).prepend('<div class="item_resized"></div>');
            }).delegate('li', 'mouseout',function() {
                /* Remove Img-Container */
                $(this).find('.item_resized').remove(); 
            });
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I try to do a simple image slideshow in php (just cycle images, no
I've just been learning some jQUery to get a basic image gallery going on
according to this image, i try to save data in NSUserDefaults but my App
I am following the Android Gallery tutorial ( http://developer.android.com/guide/tutorials/views/hello-gallery.html ) but instead of simple
I'm building an image gallery with Codeigniter everything is going good so far, but
I have an image gallery. There is a list of thumbs. When you hover
My application adds a photo from your gallery to an ImageView just fine, but
On http://allmyzip.com/colorbox1/ there is a simple image gallery with the jQuery Colorbox/Lightbox plugin for
In my app i am using this code to get Image from Gallery and
I am currently using PIL. from PIL import Image try: im = Image.open(filename) #

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.