
September 11th, 2012, 03:15 PM
|
|
Registered User
|
|
Join Date: Sep 2012
Posts: 2
Time spent in forums: 1 h 4 m 58 sec
Reputation Power: 0
|
|
Quote: | Originally Posted by ManiacDan Is there any particular thing you need help with? I don't see a question or an error message. Do you debug JS in firebug or chrome debugger? |
I want to show name, phone and email when someone moves the mouse over the picture. I dont how to do that. I am new to Javascript. Below is my complete program.
Code:
<HTML>
<HEAD>
<TITLE> KINGS WEBSITE </TITLE>
<link rel = "stylesheet" type="text/css" href="css/basic_004.css" />
<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>
<!-- Adding Image -->
<img src = "KingLogo.jpg" width ="576" height= "87">
<div id = "FeatureHouse">
<?php
print " <p><strong><h3> Featured Home! </strong> </h3> </p>";
print "<p><img src='/images/house_mallard_1.jpg'></p>\n";
print "<p> <h3> <strong> Won't last long at this price! </p> </h3> </strong>";
print "<p> <br /> Enjoy the quiet in this Mallard Manor home.
Lovely garden views and a short walk to the
golf course for those who can't get enough
of green living.
<p>";
?>
</div>
<div id = "findCity">
<Form method = "Post" action="Assignment_8_HouseList.php">
Enter City:
<input type = " text" name="findCity" size="30">
<p> (Leave blank to find all houses listed) </p>
<input type = "Submit" value = "Find City">
<p> Note: We represent homes in the following cities: OceanCove, Tomsville, Pine Beach </p>
</div>
<!-- <div id="validusers">
</div>
<div id="errordiv" style="color: red;">
</div> -->
<! ********************************* -->
<! Displaying Realtors List -->
<! ********************************* -->
<div id = "calculator">
<?php
include 'Assignment_8_Using_common_functions.php';
displayRealtors();
?>
</div>
<div id="endpage">
<br /><br /><br /><br />
</div>
<?php
function displayRealtors()
{
$statement = "SELECT lastname, firstname, phone, email, image_file ";
$statement .= "FROM s1583_realtor ";
$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>
|