javascript mouseover image popup with text in the popup and close button

ZeteextebrA

New Member
My current code pops up an image when I mouseover a link.I want to add functionality that in addition to the image, a text description is also in the popup.In addition, I also want an 'X' close button on the popup window that will close the popup when clicked. Currently, the image goes away when I mouseout. But I want to have the close button also.How do I make these additions?Here is my current javascript code:\[code\]$(document).ready(function() { var offsetX = 10;var offsetY = 5;$('.menu').mouseover(function(e) { console.log(e); var href = http://stackoverflow.com/questions/13712854/$(this).attr('href'); $('<img id="image" src="' + href + '"/>') .css('top', e.pageY + offsetY) .css('left', e.pageX + offsetX) .appendTo('body');}, function(e) { $('#image').remove();});$('.menu').mouseout(function(e) { $("#image").css('top', e.pageY + offsetY).css('left', e.pageX + offsetX); $('#image').remove();});});\[/code\]Here is some example html code:\[code\]<a id='image1' class='menu' href="http://stackoverflow.com/questions/13712854/images/image1.jpg" alt=""><b>Image Description:</b> Text about this image.</a>\[/code\]Thanks
 
Back
Top