Solved

Trouble with jquery image link hover popup flickering

Posted on 2010-09-15
2
792 Views
Last Modified: 2012-05-10
I have a jquery function that shows a larger image in a jquery popup when the user hovers over the image link.

in this example: http://www.armtech.us/clients/purrWholesale/products.php?categoryId=10  hover over "Alpine" and you can see the issue.

This is the code:

            
      $(function(evt) {
        $("a:has(img.productsImg)").hover(
            function() {
                        var largePath = $(this).attr("title");
                        var offset = $("#container").offset();
                  
                        $("#photo_large").attr({ src: largePath });
                $("#tooltip1").css("top", offset.top).css("left", offset.left).css("display", "block");
                $("#tooltip1").animate({ opacity: 1.0 }, 300);
            },
            function() {
                $("#tooltip1").animate({ opacity: 0.0 }, 300, function() {
                    $("#tooltip1").css("display", "none");
                });
            }
        );
    });


and the   tooltip:
<div class="tooltipContent" id="tooltip1">
        <img src="" id="photo_large" /></div>
0
Comment
Question by:JGoyer
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 22

Accepted Solution

by:
kadaba earned 500 total points
ID: 33683417
try this way.

$(function(evt) {
        $("a:has(img.productsImg)").hover(
		function() {
				var largePath = $(this).attr("title");
				var offset = $("#container").offset();
			
				$("#photo_large").attr({ src: largePath });
                $("#tooltip1").css("top", offset.top).css("left", offset.left).css("display", "block");
                $("#tooltip1").animate({ opacity: 1.0 }, 300);
            }
        );
		$("#tooltip1").mouseout(function() {
			$("#tooltip1").animate({ opacity: 0.0 }, 300, function() {
				$("#tooltip1").css("display", "none");
			});
		});
    });

Open in new window

0
 
LVL 2

Author Closing Comment

by:JGoyer
ID: 33708739
Perfect!  Thanks!
0

Featured Post

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question