Solved

how can i make a popup image html on mouseover event

Posted on 2012-04-01
1
155 Views
Last Modified: 2012-04-11
hi...

someone know how can i make a popup image in html when happen moseover event at a text?

i have this code but it don't run

    <td height="83" rowspan="2">&nbsp;</td>
    <td width="87" height="87" bordercolor="#FFFFFF" bgcolor="#FFFFFF">
    <a onmouseover="popup ('<img src= images/texto1.gif>','90px');"> hola</a>
 
     
    <font color="blue"><span title="Calidad en desarrollos humanos , tu mejor opcion">FILOSOFIA</span></font><br />
   
    <font color= "green"><span title="Confianza , Honestidad, Respeto, Eficiencia, Eficacia, Cooperacion">VALORES</span></font><br />
index.html
0
Comment
Question by:tenriquez199
1 Comment
 
LVL 16

Accepted Solution

by:
HagayMandel earned 500 total points
ID: 37795338
With the help of Jquery
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Image in a box</title>
<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script type="text/javascript" language="javascript">
 $(document).ready(function(){ 	
	xOffset = 5;
	yOffset = 20;
    $("#trial").hover(function (e) {		
		$("#message")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");	
			$("body").append("<div id='message'><img src='https://www.google.com/images/srpr/logo3w.png' width='200px' height='60px'></div>");					
    },
	function(){			
		$("#message").remove();
    });	
	$("#trial").mousemove(function (e) {					
			$('#message').css("top",(e.pageY - xOffset) + "px");
			$('#message').css("left",(e.pageX + yOffset) + "px");
			$('#message').fadeIn("fast");		    });
  	});  
	$("#trial").mouseleave(function () {		
		$("#message").hide();		
	});	
	
</script>
<style type="text/css">
<!--
#message {
	border:thin solid #CCCCCC;
	width: 200px;
	display:none;
	position:absolute;
}
-->
</style>
</head>

<body>
<a href="#" id="trial">Test text</a>
</body>
</html>

Open in new window

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
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)

895 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now