I need to display picture name when i move mouseover the picture using onmouseover. Please let me know what I need to add either to javascript or to PHP.
<style>
#contactdiv
{
position: absolute;
left: 100px;
top: 100px;
width: 100px:
height: 20px;
padding: 5px;
background-color: red;
visibility: hidden;
}
</style>
<script>
function showcontact(element)
{
var contactdiv = document.getElementById('contactdiv');
x = element.offsetLeft;
y = element.offsetTop;
contactdiv.style.left = x + 170;
contactdiv.style.top = y + 30;
contactdiv.style.visibility = 'visible';
}
function hidecontact()
{
var contactdiv = document.getElementById('contactdiv');
contactdiv.style.visibility = 'hidden';
}
</script>
</HEAD>
<body>
<!-- <div id="validusers">
</div>
<div id="errordiv" style="color: red;">
</div> -->
<! ********************************* -->
<! Displaying Realtors List -->
<! ********************************* -->
<div id = "calculator">
<?php
include 'using-Myfile.php';
displayRealtors();
?>
</div>
<?php
function displayRealtors()
{
$statement = "SELECT lastname, firstname, phone, email, image_file ";
$statement .= "FROM table ";
$statement .= "ORDER BY firstname ";
$sqlResults = selectResults($statement);
$error_or_rows = $sqlResults[0];
if (substr($error_or_rows, 0 , 5) == 'ERROR')
{
print "<br />Error on DB";
print $error_or_rows;
}
else
{
$arraySize = $error_or_rows;
for ($i=1; $i <= $error_or_rows; $i++)
{
$lastname = $sqlResults[$i]['lastname'];
$firstname = $sqlResults[$i]['firstname'];
$phone = $sqlResults[$i]['phone'];
$email = $sqlResults[$i]['email'];
$image_file = $sqlResults[$i]['image_file'];
$fullName = "$firstname $lastname";
print "<p><img src='images/".$image_file."' onMouseOver = showcontact('this','".$lastname."') onmouseout = hidecontact(this)>";
print "<br />".$firstname."</p>\n";
}
}
}
?>
<div id = "contactdiv">
</div>
<div id="footer">
<p> <a href = " Assignment_8_GuestBook_Form.php "> View Guestbook </a> /
<a href = " Assignment_8_CalculateMortgage.php "> Calculate Mortgage </a>
</p>
</div>
</body>
</HTML>