I written a code to create a image viewer using javascript. But the script only works in IE but not in firefox. Please help.
The code is below......
<script type="text/javascript">
function changeImage(filename)
{
mainimage.src = filename;
}
</script>
<center>
<img src="images/bg.jpg" name="mainimage" width="419" height="282">
<marquee width="90%" scrollamount="5" onmouseover="this.stop();" onmouseout="this.start();">
<?php
include 'database_conn.php';
$tbl_name="property";
$sql = "SELECT * FROM $tbl_name WHERE worth='1' && activation='1'";
$query = mysql_query($sql) or die(mysql_error());
echo "<table><tr>";
while ($row =mysql_fetch_array($query))
{
$title = $row['title'];
$area = $row['area'];
$propertyid = $row['propertyid'];
$image1 = $row['image1'];
$contact = $row['contact'];
$price = $row['price'];
if (empty($image1))
{
$image1 = "uploaded_files/no photo.jpg";
?><a href="javascript:changeImage('<?php echo $image1;?>')"><td><center><?php echo "$title";?></center><img src="<?php echo $image1;?>" width='90' height='80'><br><center><a href='detail.php?propertyid=<?php echo "$propertyid'"; ?>'>Details</a></center></td><?php
}
else
{
?><a href="javascript:changeImage('<?php echo $image1;?>')"><td><center><?php echo "$title";?></center><img src="<?php echo $image1;?>" width='90' height='80'><br><center><a href='detail.php?propertyid=<?php echo "$propertyid'"; ?>'>Details</a></center></td><?php
}
}
echo "</tr></table>";
mysql_close($conn);
?></marquee></center>
Reply With Quote