Jump to content

OnMouseover Help!


XAceX

Recommended Posts

I am a Javascript newb. I need a code for 4 different OnMouseover. It's four pictures four different links. Can Anyone help? :)

Link to comment
Share on other sites

In the code there are four Images. They are each Linked to different pages. I already made the pictures that should appear when you mouse over the image. All I want to do is make that function. This is my code:

<div id=title><b>Welcome to the Website of<br>FGL Environmental & Fruit Growers Laboratory, Inc.</b></div><br><div id=one><!--<table width=100% bgcolor=#E0EEEE cellpadding=0 cellspacing=0>--><table width=100% bgcolor=#e3ede3 cellpadding=0 cellspacing=0><tr><td align=center>  <table>  <tr>  <td class=index>  <p class=two>  <b>FGL</b> provides analytical services to agriculture, waste water dischargers, drinking water purveyors, hazardous waste generators, industrial engineering consulting, and governmental agencies.  We are fully accredited by the <b>National Environmental Laboratory Accreditation Program (NELAP)</b> for drinking water, waste water, hazardous waste and mixed waste analyses.<br>  </p>  <?php$DATE=date("Y-m-d");$query="SELECT Event,Date FROM fgl.Upcoming_Events WHERE DATE > '$DATE' ORDER BY DATE ASC LIMIT 3";$result=mysql_query($query);if($result){	$count=mysql_num_rows($result);} else {	$count=0;}?>   	<br>		<div align=center>	<table width=550 border=0>	<tr valign=middle>	<td align=left width=350>	<p class=margin>	- <a href=frmAboutUs.php?choice=references&currentpage=AboutUs class=ref>About FGL</a><br>	- <a href=frmCustomerServices.php?choice=agronomics&currentpage=CustomerServices class=ag>Agronomic Services</a><br>	- <a href=frmCustomerServices.php?choice=environmental&currentpage=CustomerServices class=env>Environmental Services</a><br>	</p>		<br>	<?php $indent="    "; ?>		<b><font face=arial>  Locations:</font></b><br>	<div style="margin-left: 20px">		<a href=frmLocations.php?currentpage=Locations&choice=santapaula class=locations>Southern California - Santa Paula</a><br>		<a href=frmLocations.php?currentpage=Locations&choice=visalia class=locations>Central California - Visalia</a><br>		<a href=frmLocations.php?currentpage=Locations&choice=stockton class=locations>Northern California - Stockton</a><br>			<a href=frmLocations.php?currentpage=Locations&choice=chico class=locations>Northern California - Chico</a><br>		</div>	<br>	<b><font face=arial>  Holiday Hours:</font></b><br>	<div style="margin-left: 20px">		<a href=frmLocations.php?currentpage=Locations&choice=santapaula class=locations>Santa Paula</a><br>	    <a href=frmLocations.php?currentpage=Locations&choice=stockton class=locations>Stockton</a><br>		<a href=frmLocations.php?currentpage=Locations&choice=chico class=locations>Chico</a>		</div>	<br>		</td>	<td align=right width=200>		<table border=0>		<tr>		<td><a href=frmCustomerServices.php?currentpage=CustomerServices&choice=agronomics><img src=images/HomeStrawWatermelon.jpg border=0></a></td>		<td><a href=frmCustomerServices.php?currentpage=CustomerServices&choice=drinking><img src=images/Homewater.jpg border=0></a></td>		</tr>		<tr>		<td><a href=frmCustomerServices.php?currentpage=CustomerServices&choice=waste><img src=images/HomeWaste.jpg border=0></a></td>		<td><a href=frmCustomerServices.php?currentpage=CustomerServices&choice=hazardous><img src=images/HomeHaz.jpg border=0></a></td>		</tr>		</table>	</td>	</tr>	</table>	<br>	<div style="padding: 30px; padding-top:5px; background-image: url('images/LatestNewsBack.gif');">	<div align=left style="font-size:15pt;font-weight:bold;margin-top:6px;"><b>FGL Latest News</b></div><br>	<?php	//Database Accessing		echo "<div align=left>";	$Result = mysql_query("SELECT Date, Title, Text FROM LatestNews WHERE State='Active' ORDER by Date desc LIMIT 1");	if (!$Result) {		die('Invalid query: ' . mysql_error());	}		//Declares amount of articles to be shown; default is most recent 5 articles.	$TotalRows = mysql_num_rows($Result);	$ShowAmount = $_GET['ShowAmount'];	$DefaultAmount = 5;	if ($TotalRows > 5 && $ShowAmount == 5) {		echo "<a href='Latest_News.php?ShowAmount=$TotalRows'>Show All Articles ($TotalRows)<br></a>";	}elseif ($TotalRows > 5 && $ShowAmount > 5) {		echo "<a href='Latest_News.php?ShowAmount=5'>Show 5 Most Recent Articles<br></a>";	}elseif ($TotalRows > 5 && $ShowAmount == 0) {		$ShowAmount = $DefaultAmount;		echo "<a href='Latest_News.php?ShowAmount=$TotalRows'>Show All Articles ($TotalRows)<br></a>";	}else {		$ShowAmount = $TotalRows;	}	//Displays Articles in both short and long forms.	$CurrentRow = 0;	echo "<table border=0>";	$ViewArticleNum = $_GET['ViewArticle'];	while ($CurrentRow < $ShowAmount){		$Date = mysql_result($Result, $CurrentRow, 'Date');		$Month = substr($Date, 5, 2);		$Day = substr($Date, 8, 2);		$Year = substr($Date, 0, 4);		$Date = date("M j, Y", mktime(0, 0, 0, $Month, $Day, $Year));		$Title = mysql_result($Result, $CurrentRow, 'Title');		$Text = mysql_result($Result, $CurrentRow, 'Text');		$Text=str_replace("''","'",$Text);		$CutText = substr($Text, 0, 155);		$URLReader = "Latest_News.php?ShowAmount=$ShowAmount&ViewArticle=$CurrentRow";		$TagFinder = strpos($URLReader, '#');		$TagReader = substr($URLReader, $TagFinder);		echo "<tr>";			echo "<td><a name='Tag$CurrentRow'><b>$Date</b></a></td>";		echo "</tr>";		echo "<tr>";			echo "<td valign=top><a href='$URLReader#Tag$CurrentRow' style='text-decoration:none;'><font size='+1' color='#0040EE'><b>$Title</b></font></a></td>";		echo "</tr>";		echo "<tr>";			echo "<td><hr></td>";		echo "</tr>";		echo "<tr>";		if ($ViewArticleNum == $CurrentRow && $ViewArticleNum != ""){			echo "<td valign = top'>$Text</td>";		}else{			echo "<td valign = top'>";				echo "$CutText...";				echo "<a href='$URLReader#Tag$CurrentRow' style='color:blue;font-weight:bold;'>Click Here View Full Article</a>";			echo "</td>";		}		echo "</tr>";			$CurrentRow++;	}	echo "</table>";	echo "</div>";	?>	</div>	</div>   <br>  </td>  </tr>  </table>

Link to comment
Share on other sites

Here's a snazzy little chunk:

<html>  <head>	<title>Image Swap</title>	<script type="text/javascript">	function swap_img(el, img)	{	  old_src = el.src;	  el.src = img;	  el.onmouseout = function() { this.src = old_src };	}	</script>  </head>  <body>	<img src="false.jpg" onmouseover="swap_img(this, 'true.jpg');">	<img src="false2.jpg" onmouseover="swap_img(this, 'true2.jpg');">	<img src="false3.jpg" onmouseover="swap_img(this, 'true3.jpg');">	    </body></html>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...