phprockers-logo

Show the content or text when mouse over the link


<style type="text/css">
<!--
.box {
background-color: #F4F4F4;
border: 1px solid #CCC;
height: 150px;
width: 225px;
padding: 5px;
display:none;
position:absolute;
}


-->
</style>
<script type="text/javascript" language="JavaScript">
var cX = 0; var cY = 0; var rX = 0; var rY = 0;
function UpdateCursorPosition(e){ cX = e.pageX; cY = e.pageY;}
function UpdateCursorPositionDocAll(e){ cX = event.clientX; cY = event.clientY;}
if(document.all) { document.onmousemove = UpdateCursorPositionDocAll; }
else { document.onmousemove = UpdateCursorPosition; }
function AssignPosition(d) {
if(self.pageYOffset) {
rX = self.pageXOffset;
rY = self.pageYOffset;
}
else if(document.documentElement && document.documentElement.scrollTop) {
rX = document.documentElement.scrollLeft;
rY = document.documentElement.scrollTop;
}
else if(document.body) {
rX = document.body.scrollLeft;
rY = document.body.scrollTop;
}

if(document.all) {
cX += rX;
cY += rY;
}
d.style.left = (cX-50) + "px";
d.style.top = (cY-170) + "px";
}
function HideText(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "none";
}
function ShowText(d) {
if(d.length < 1) { return; }
var dd = document.getElementById(d);
AssignPosition(dd);
dd.style.display = "block";
}
function ReverseContentDisplay(d) {
if(d.length < 1) { return; }
var dd = document.getElementById(d);
AssignPosition(dd);
if(dd.style.display == "none") { dd.style.display = "block"; }
else { dd.style.display = "none"; }
}
//-->
</script>




<span
onmouseover="ShowText('Message'); return true;"
onmouseout="HideText('Message'); return true;"
href="javascript:ShowText('Message')">
Contact Us
</span>
<div
id="Message"
class="box"
>
Ramakrishnan V.<br/>
14,Robinson Park Colony,<br/>
M.C. Road,<br/>
Old Washermenpet,<br/>
Chennai-600 021.<br/>
Contact No: 9445094568.
</div>   

0 comments:

Post a Comment