Solved

Trouble with jquery image link hover popup flickering

Posted on 2010-09-15
2
782 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
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
jquery conditionally populate list boxes 2 31
jQuery Validate 4 37
How can i  prevent default  Submision? 6 28
jquery datable hidden section doesn't submit 2 11
Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
PROBLEM: The other day I was working on adding an ajax request to a webpage that already had a dialog box on the page.  The dialog box was using relative positioning to be positioned next to a form field I had on the page.  Everything was working…
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)

803 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