Difference between revisions of "Team:Marburg/Gallery"
(4 intermediate revisions by the same user not shown) | |||
Line 220: | Line 220: | ||
z-index:1; | z-index:1; | ||
height:450px; | height:450px; | ||
− | |||
padding:10px; | padding:10px; | ||
opacity:0.0; | opacity:0.0; | ||
Line 269: | Line 268: | ||
<li><a href="https://2015.igem.org/Team:Marburg/Curli">NUTRInity - Pick up</a></li> | <li><a href="https://2015.igem.org/Team:Marburg/Curli">NUTRInity - Pick up</a></li> | ||
<li><a href="https://2015.igem.org/Team:Marburg/CDI">NUTRInity - Cut off</a></li> | <li><a href="https://2015.igem.org/Team:Marburg/CDI">NUTRInity - Cut off</a></li> | ||
+ | <li><a href="https://2015.igem.org/Team:Marburg/Design">Future Application</a></li> | ||
<li><a href="https://2015.igem.org/Team:Marburg/InterLab">InterLab Study</a></li> | <li><a href="https://2015.igem.org/Team:Marburg/InterLab">InterLab Study</a></li> | ||
<li><a href="https://2015.igem.org/Team:Marburg/Measurement">Measurement Study</a></li> | <li><a href="https://2015.igem.org/Team:Marburg/Measurement">Measurement Study</a></li> | ||
Line 278: | Line 278: | ||
<li><a href="https://2015.igem.org/Team:Marburg/Hessentag">Hessentag</a></li> | <li><a href="https://2015.igem.org/Team:Marburg/Hessentag">Hessentag</a></li> | ||
<li><a href="https://2015.igem.org/Team:Marburg/Killswitch">KillSwitch Statistics</a></li> | <li><a href="https://2015.igem.org/Team:Marburg/Killswitch">KillSwitch Statistics</a></li> | ||
− | |||
</ul> | </ul> | ||
</li> | </li> | ||
Line 342: | Line 341: | ||
<div style="z-index:1;text-align:center;padding-bottom:50px;"><img src="https://static.igem.org/mediawiki/2015/a/a7/MR_pic_Button_Gallery.png" style="height:60px;"/></div> | <div style="z-index:1;text-align:center;padding-bottom:50px;"><img src="https://static.igem.org/mediawiki/2015/a/a7/MR_pic_Button_Gallery.png" style="height:60px;"/></div> | ||
− | <div id="fader" style="margin-left: | + | <div id="fader" style="margin-left:120px;margin-bottom:30px;"> |
<img src="https://static.igem.org/mediawiki/2015/7/71/MR_pic_TeamfunAnna.jpg" alt="Anna" /> | <img src="https://static.igem.org/mediawiki/2015/7/71/MR_pic_TeamfunAnna.jpg" alt="Anna" /> | ||
<img src="https://static.igem.org/mediawiki/2015/9/91/MR_pic_TeamfunAlex.jpg" alt="Alex" /> | <img src="https://static.igem.org/mediawiki/2015/9/91/MR_pic_TeamfunAlex.jpg" alt="Alex" /> | ||
Line 378: | Line 377: | ||
$.fn.initGallery = function() { | $.fn.initGallery = function() { | ||
//SCALE CONTAINER | //SCALE CONTAINER | ||
− | + | var fades = $('img',this); | |
− | + | var maxwidth = 0; | |
− | + | var maxheight = 0; | |
− | + | fades.each(function() { | |
− | + | maxwidth = ($(this).outerWidth() > maxwidth) ? $(this).outerWidth() : maxwidth; | |
− | + | maxheight = ($(this).outerHeight() > maxheight) ? $(this).outerHeight() : maxheight; | |
}); | }); | ||
− | + | this.height( maxheight ); | |
− | + | this.width( maxwidth ); | |
//FIX IMAGE POSITIONS | //FIX IMAGE POSITIONS | ||
fades.each(function() { | fades.each(function() { | ||
Line 401: | Line 400: | ||
} | } | ||
return this; | return this; | ||
+ | } | ||
+ | $.fn.rescaleGallery = function() { | ||
+ | //SCALE CONTAINER | ||
+ | $(this).ready(function() { | ||
+ | var parent = $('#fader'); | ||
+ | var fades = $('#fader img'); | ||
+ | var maxwidth = 0; | ||
+ | var maxheight = 0; | ||
+ | console.log("CALL on " + $(this).attr('alt') + " :" + fades.length); | ||
+ | fades.each(function() { | ||
+ | maxwidth = ($(this).outerWidth() > maxwidth) ? $(this).outerWidth() : maxwidth; | ||
+ | maxheight = ($(this).outerHeight() > maxheight) ? $(this).outerHeight() : maxheight; | ||
+ | }); | ||
+ | parent.height( maxheight ); | ||
+ | parent.width( maxwidth ); | ||
+ | //FIX IMAGE POSITIONS | ||
+ | fades.each(function() { | ||
+ | if( $(this).outerWidth() < maxwidth-2) | ||
+ | $(this).css('left',(maxwidth/2 - $(this).outerWidth()/2)); | ||
+ | if( $(this).outerHeight() < maxheight-2) | ||
+ | $(this).css('top',(maxheight/2 - $(this).outerHeight()/2)); | ||
+ | }); | ||
+ | }); | ||
} | } | ||
$.fn.setFader = function(interval,fadetime) { | $.fn.setFader = function(interval,fadetime) { | ||
Line 425: | Line 447: | ||
slideid = $('#fader').initGallery().setFader(3000,500); | slideid = $('#fader').initGallery().setFader(3000,500); | ||
$('#fader').hover(function() {clearInterval(slideid);},function() {slideid = $(this).setFader(3000,500);}); | $('#fader').hover(function() {clearInterval(slideid);},function() {slideid = $(this).setFader(3000,500);}); | ||
− | $('#fader img'). | + | $('#fader img').rescaleGallery(); |
}); | }); | ||
</script> | </script> |
Latest revision as of 17:12, 16 September 2015