Team:Sevilla/Gallery

From 2011.igem.org

(Difference between revisions)
Line 1: Line 1:
{{:Team:Sevilla/Templates/general}}
{{:Team:Sevilla/Templates/general}}
-
<html>
+
 
-
<!=====================================================HTML====================================-->
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
-
<ul class="thumb">
+
<html xmlns="http://www.w3.org/1999/xhtml">  
-
<li><a href="#"><img src="https://lh3.googleusercontent.com/--fN95DhBGM8/TibGE2DB7-I/AAAAAAAAAWE/MDonZbL0fNA/s144/IMG_4705.JPG.jpg" alt="" /></a></li>
+
<head>  
-
<li><a href="#"><img src="https://lh5.googleusercontent.com/-8Q17V5HrLcc/TibGG1sr18I/AAAAAAAAAWY/Ny7zIgjZCKg/s144/IMG_4699.JPG" alt="" /></a></li>
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />  
-
<li><a href="https://lh4.googleusercontent.com/-2X_yY8oENAQ/Tif3nCcE1KI/AAAAAAAAAYo/4UJKu-X5Wbk/s800/IMG_4750.JPG"><img src="https://lh4.googleusercontent.com/-2X_yY8oENAQ/Tif3nCcE1KI/AAAAAAAAAYo/4UJKu-X5Wbk/s144/IMG_4750.JPG" alt="" /></a></li>
+
<title>Fancy Thumbnail Hover Effect w/ jQuery - by Soh Tanaka</title>  
-
<li><a href="#"><img src="thumb4.jpg" alt="" /></a></li>
+
<style type="text/css">  
-
<li><a href="#"><img src="thumb5.jpg" alt="" /></a></li>
+
body {
-
<li><a href="#"><img src="thumb6.jpg" alt="" /></a></li>
+
font: Arial, Helvetica, sans-serif normal 10px;
-
<li><a href="#"><img src="thumb7.jpg" alt="" /></a></li>
+
margin: 0; padding: 0;
-
<li><a href="#"><img src="thumb8.jpg" alt="" /></a></li>
+
}
-
<li><a href="#"><img src="thumb9.jpg" alt="" /></a></li>
+
* {margin: 0; padding: 0;}
-
</ul>
+
img {border: none;}
-
<!=====================================================CSS====================================-->
+
.container {
-
<style>
+
height: 360px;
 +
width: 910px;
 +
margin: -180px 0 0 -450px;
 +
top: 50%; left: 50%;
 +
position: absolute;
 +
}
ul.thumb {
ul.thumb {
float: left;
float: left;
Line 25: Line 30:
margin: 0; padding: 5px;
margin: 0; padding: 5px;
float: left;
float: left;
-
position: relative; /* Set the absolute positioning base coordinate */
+
position: relative;
width: 110px;
width: 110px;
height: 110px;
height: 110px;
}
}
ul.thumb li img {
ul.thumb li img {
-
width: 100px; height: 100px; /* Set the small thumbnail size */
+
width: 100px; height: 100px;
-
-ms-interpolation-mode: bicubic; /* IE Fix for Bicubic Scaling */
+
border: 1px solid #ddd;
border: 1px solid #ddd;
padding: 5px;
padding: 5px;
Line 37: Line 41:
position: absolute;
position: absolute;
left: 0; top: 0;
left: 0; top: 0;
 +
-ms-interpolation-mode: bicubic;
}
}
ul.thumb li img.hover {
ul.thumb li img.hover {
-
background:url(thumb_bg.png) no-repeat center center; /* Image used as background on hover effect
+
background:url(thumb_bg.png) no-repeat center center;
-
border: none; /* Get rid of border on hover */
+
border: none;
}
}
-
</style>
+
#main_view {
-
<!=====================================================JS====================================-->
+
float: left;
-
<script type="text/javascript">
+
padding: 9px 0;
 +
margin-left: -10px;
 +
}
 +
</style>  
 +
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>  
 +
<script type="text/javascript">  
 +
$(document).ready(function(){
 +
 +
//Larger thumbnail preview
 +
$("ul.thumb li").hover(function() {
$("ul.thumb li").hover(function() {
-
$(this).css({'z-index' : '10'}); /*Add a higher z-index value so this image stays on top*/
+
$(this).css({'z-index' : '10'});
-
$(this).find('img').addClass("hover").stop() /* Add class of "hover", then stop animation queue buildup*/
+
$(this).find('img').addClass("hover").stop()
.animate({
.animate({
-
marginTop: '-110px', /* The next 4 lines will vertically align this image */
+
marginTop: '-110px',  
-
marginLeft: '-110px',
+
marginLeft: '-110px',  
-
top: '50%',
+
top: '50%',  
-
left: '50%',
+
left: '50%',  
-
width: '174px', /* Set new width */
+
width: '174px',  
-
height: '174px', /* Set new height */
+
height: '174px',
-
padding: '20px'
+
padding: '20px'  
-
}, 200); /* this value of "200" is the speed of how fast/slow this hover animates */
+
}, 200);
-
 
+
} , function() {
} , function() {
-
$(this).css({'z-index' : '0'}); /* Set z-index back to 0 */
+
$(this).css({'z-index' : '0'});
-
$(this).find('img').removeClass("hover").stop() /* Remove the "hover" class , then stop animation queue buildup*/
+
$(this).find('img').removeClass("hover").stop()
.animate({
.animate({
-
marginTop: '0', /* Set alignment back to default */
+
marginTop: '0',  
marginLeft: '0',
marginLeft: '0',
-
top: '0',
+
top: '0',  
-
left: '0',
+
left: '0',  
-
width: '100px', /* Set width back to default */
+
width: '100px',  
-
height: '100px', /* Set height back to default */
+
height: '100px',  
padding: '5px'
padding: '5px'
}, 400);
}, 400);
});
});
-
</script>
+
-
 
+
//Swap Image on Click
-
 
+
$("ul.thumb li a").click(function() {
-
 
+
 +
var mainImage = $(this).attr("href"); //Find Image Name
 +
$("#main_view img").attr({ src: mainImage });
 +
return false;
 +
});
 +
 +
});
 +
</script>  
 +
</head>
 +
 +
<body>
 +
<div class="container">
 +
<ul class="thumb">
 +
<li><a href="#"><img src="https://lh3.googleusercontent.com/--fN95DhBGM8/TibGE2DB7-I/AAAAAAAAAWE/MDonZbL0fNA/s144/IMG_4705.JPG.jpg" alt="" /></a></li>
 +
<li><a href="https://lh5.googleusercontent.com/-0W6X9-bK_qA/TibGHbXNG1I/AAAAAAAAAWg/VgdXn-Sz438/s800/IMG_4698.JPG"><img src="https://lh5.googleusercontent.com/-0W6X9-bK_qA/TibGHbXNG1I/AAAAAAAAAWg/VgdXn-Sz438/s144/IMG_4698.JPG" alt="" /></a></li>
 +
<li><a href="#"><img src="https://lh4.googleusercontent.com/-2X_yY8oENAQ/Tif3nCcE1KI/AAAAAAAAAYo/4UJKu-X5Wbk/s144/IMG_4750.JPG" alt="" /></a></li>
 +
<li><a href="#"><img src="thumb4.jpg" alt="" /></a></li>
 +
<li><a href="#"><img src="thumb5.jpg" alt="" /></a></li>
 +
<li><a href="#"><img src="thumb6.jpg" alt="" /></a></li>
 +
<li><a href="#"><img src="thumb7.jpg" alt="" /></a></li>
 +
<li><a href="#"><img src="thumb8.jpg" alt="" /></a></li>
 +
<li><a href="#"><img src="thumb9.jpg" alt="" /></a></li>
 +
</ul>
 +
<div id="main_view">
 +
 +
</div>
 +
</div>
 +
 +
 +
</body>
</html>
</html>

Revision as of 17:11, 23 July 2011


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> Fancy Thumbnail Hover Effect w/ jQuery - by Soh Tanaka