Switch to full style
JavaScript code examples
Post a reply

Popup message using JavaScript without using alert function

Fri Jan 18, 2013 8:57 pm

Popup message using javascript when mouse is over a text content without using alert function.
javascript code
<html>
<head>
<title>
Popup message using javascript
</title>

<style type="text/css">
.boxpopup {
font-family:Arial,sans-serif;
text-align:center;
color:black; background:#89FFFF;
width:300px;
padding:5px 6px 5px 6px;
font-weight:bold;
border:1px dashed gray;
font-size:90%;
}
#boxTail {position:absolute; visibility:hidden; z-index:200;}

</style>
</head>


<body>
<div id="boxTail"></div>
<script TYPE="text/javascript">
paddingPOPX=-135;
paddingPOPY=25;
var skn,iex=(document.all),shiftPosition=-1000;
var ns4=document.layers
var ns6=document.getElementById&&!document.all
var ie4=document.all
if (ns4) myPOPCP=document.boxTail
else if (ns6) myPOPCP=document.getElementById("boxTail").style
else if (ie4) myPOPCP=document.all.boxTail.style
if (ns4) document.captureEvents(Event.MOUSEMOVE);
else {
myPOPCP.visibility="visible"
myPOPCP.display="none"
}
document.onmousemove=get_mouse;
function showPopup(content){
var content="<div class=boxpopup>"+content+"</div>";
shiftPosition=paddingPOPY;
if(ns4){myPOPCP.document.write(content);myPOPCP.document.close();myPOPCP.visibility="visible"}
if(ns6){document.getElementById("boxTail").innerHTML=content;myPOPCP.display=''}
if(ie4){document.all("boxTail").innerHTML=content;myPOPCP.display=''}
}
function get_mouse(e){
var x=(ns4||ns6)?e.pageX:event.x+document.body.scrollLeft;
myPOPCP.left=x+paddingPOPX;
var y=(ns4||ns6)?e.pageY:event.y+document.body.scrollTop;
myPOPCP.top=y+shiftPosition;
}
function remove_popup(){
shiftPosition=-1000;
if(ns4){myPOPCP.visibility="hidden";}
else if (ns6||ie4)
myPOPCP.display="none"
}
//-->
</script>

<p align=center>
<a href="/" alt="" onMouseOver="javascript:showPopup('Popup message Here ');";
onMouseOut="remove_popup()">Your user content here. Your user content here. Your user content here.</a>
</p>
</body>


</html>




Post a reply
  Related Posts  to : Popup message using JavaScript without using alert function
 Popup message without using javascript     -  
 Need help with JavaScript function calculate the total pric!     -  
 Document Object Write Function in JavaScript     -  
 Get job’s Alert In Your Inbox     -  
 displaying alert box in html     -  
 Show popup dialog using JQuery     -  
 Choice choiceList popup list of choices     -  
 JMS Message Consumer Example     -  
 Trace soap message     -  
 Java message service(JMS)     -  

Topic Tags

JavaScript Functions