I have the following code to show the images from database "abc".Now I want to create a css code to enlarge the thumbnails when I roll the mouse over the images just like thumbnail gallery shown in dynamic drive. How to do that? I have tried the following CSS but it is not working!!
Please can anyone help me with these?Will be greatly obliged
I have created a table called 'image' inside 'abc' database,the fields are 1)id (primary key and auto-incremented) and 2)image(varchar).Actually this is for a uploaded image gallery.PHP Code:<?php
mysql_connect("localhost","root","a123");
mysql_select_db("abc");
$sql="select * from image";
$res=mysql_query($sql);
?>
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<style>
.gallerycontainer{
position: relative;
/*Add a height attribute and set to largest image's height to prevent overlaying*/
}
.thumbnail img{
border: 1px solid white;
margin: 0 5px 5px 0;
}
.thumbnail:hover img{
border: 1px solid blue;
}
.thumbnail span{ /*CSS for enlarged image*/
position: absolute;
background-color: lightyellow;
padding: 5px;
left: 500px;
border: 1px dashed gray;
visibility: hidden;
color: black;
text-decoration: none;
}
.thumbnail:hover span{ /*CSS for enlarged image*/
visibility:visible;
top: 0;
left: 230px; /*position where enlarged image should offset horizontally */
z-index: 50;
}
</style>
</HEAD>
<BODY bgcolor="#CCCC00">
<CENTER>
<FONT size=6 color="#FF0000" face="Comic Sans MS">Image Gallery</FONT><BR><BR>
<hr size=2 color="#003333"><BR><BR>
<?php
if($_GET[page]!="show")
{
?>
<A HREF="4.php?page=show">Show</A>
<?php
}
?>
<A HREF="4.php">Exit</A>
<?php
if($_GET[page]=="show")
{
?>
<TABLE border=2>
<TR>
<TD>Serial No</TD>
<TD>Image</TD>
</TR>
<?php
$c=1;
while($row=mysql_fetch_array($res))
{
echo "<TR>
<TD>$c-$row[id]</TD>
<TD><IMAGE SRC='$row[image]' height='50' width='50'></TD>
</TR>";
$c++;
}
?>
</TABLE>
<BR><BR><hr size=2 color="#FF0000" width="300"><BR>
<?php
}
?>
</CENTER>
</BODY>
</HTML>
p.s.What I want to do is these -
As you will see the images will appear in rows one below the other inside <TD></TD> i.e. rows.
Now what I want is that as I hover over the thumbnail images(i have deliberately set them to 50x50 height & width) with my mouse they will enlarge to the side of the table of images or show over the image.
This are two links from dynamic drive to show what is the desired effect I want.
1)http://www.dynamicdrive.com/style/cs...image-gallery/
2)http://www.dynamicdrive.com/style/cs...-image-viewer/
Is it possible?Please Help.
Thanks in advance





Reply With Quote



Bookmarks