Solved

how can i make a popup image html on mouseover event

Posted on 2012-04-01
1
161 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
[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
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

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

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

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Find out what you should include to make the best professional email signature for your organization.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

689 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