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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:06:18+00:00 2026-06-13T13:06:18+00:00

I use mouseenter and mouseleave for larger image when you hover your mouse on

  • 0

I use mouseenter and mouseleave for larger image when you hover your mouse on it. If the mouse is moved too quickly, mouseleave does not work, and the magnified image remains.

$(document).ready(function() {
    $('.productImg').bind('mouseenter', function(){
        if(!$('#zoom_product_image').length){
            var maxWidth=$(this).parents('form').width();
            var maxHeight=$(this).parents('form').height();

            var link=this.src.replace(/small/g, 'big');
            $(this).parents('form').append('<img id="zoom_product_image" style="display: none;" src="'+link+'">');
            var img=new Image();
            img.onload=function(){
                $('#zoom_product_image').css({'position': 'absolute', 'border': '1px solid #78C7FF', 'top': '0px', 'left': '0px', 'z-index': '10000', 'opacity': '0.95', 'cursor': 'pointer'});
                $('#zoom_product_image').fadeIn(200);

                if($('#zoom_product_image').width()>maxWidth){
                    $('#zoom_product_image').css({'width': maxWidth, 'height': $('#zoom_product_image').height()*(maxWidth/$('#zoom_product_image').width())});
                }
                if($('#zoom_product_image').height()>maxHeight){
                    $('#zoom_product_image').css({'height': maxHeight, 'width': $('#zoom_product_image').width()*(maxHeight/$('#zoom_product_image').height())});
                }
            }
            img.src=link;

            $('#zoom_product_image').bind('mouseleave', function(){
                $('#zoom_product_image').detach();
            });

            $('#zoom_product_image').bind('click', function(){
                window.location.href=$('#zoom_product_image').parent().find('.bigtitle').attr('href');
            });
        }
    });
});
  • 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-13T13:06:19+00:00Added an answer on June 13, 2026 at 1:06 pm
    $(document).ready(function() {
        $('.productImg').bind('mouseenter', function(){
            if($('#zoom_product_image').length)
                $('#zoom_product_image').detach();
    
            var maxWidth=$(this).parents('form').width();
            var maxHeight=$(this).parents('form').height();
    
            var link=this.src.replace(/small/g, 'big');
            $(this).parents('form').append('<img id="zoom_product_image" style="display: none;" src="'+link+'">');
            var img=new Image();
            img.onload=function(){
                    $('#zoom_product_image').css({'position': 'absolute', 'border': '1px solid #78C7FF', 'top': '0px', 'left': '0px', 'z-index': '10000', 'opacity': '0.95', 'cursor': 'pointer', 'display': 'block'});
    
                    if($('#zoom_product_image').width()>maxWidth){
                        $('#zoom_product_image').css({'width': maxWidth, 'height': $('#zoom_product_image').height()*(maxWidth/$('#zoom_product_image').width())});
                    }
                    if($('#zoom_product_image').height()>maxHeight){
                        $('#zoom_product_image').css({'height': maxHeight, 'width': $('#zoom_product_image').width()*(maxHeight/$('#zoom_product_image').height())});
                    }
            }
            img.src=link;
    
            $(this).parents('form').bind('mouseleave', function(){
                $('#zoom_product_image').detach();
            });
    
            $('#zoom_product_image').bind('click', function(){
                window.location.href=$('#zoom_product_image').parent().find('.bigtitle').attr('href');
            });
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using http://cloud.github.com/downloads/emberjs/ember.js/ember-0.9.5.js and I'm not sure how to use the mouseenter and mouseleave
I'm trying to use mouseenter and mouseleave to start and stop a color animation
I have problem with dojo/on and handling mouseenter and mouseleave. It doesn't work for
I created a menu and I tried to use mouseover (mouseenter) and mouseout(mouseleave) but
I'm putting together an image gallery for an ecommerce site and wanting to use
So I am just trying to add some functions to hover. the below does
This is what I have currently: $(#cart-summary).mouseenter(function () { $('.flycart').delay(500).slideDown('fast'); }); $(.flycart).mouseleave(function () {
I have a dropdown box that operates with the following: $(document).on(mouseenter mouseleave, #dropdown, function(event){
I recently tried to use jQuery's effect('scale') function with the hover() function in jQuery.
Use Case Show a photo uploaded by the user in a square box with

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.