Team:KIT-Kyoto/Test

From 2014.igem.org

(Difference between revisions)
Line 11: Line 11:
</style>
</style>
-
 
+
<div id="bgimg">
-
<img src="https://static.igem.org/mediawiki/2014/4/43/KIT_pictures_hund.jpg" class="bg">
+
<div><img src="https://static.igem.org/mediawiki/2014/4/43/KIT_pictures_hund.jpg" class="bg"></div>
-
 
+
<div><img src="https://static.igem.org/mediawiki/2014/d/d2/KIT_picutures_daityoukinndots.jpg" class="bg"></div>
 +
</div>
<style>
<style>
img.bg {
img.bg {
Line 28: Line 29:
top: 0;
top: 0;
left: 0;
left: 0;
 +
}
 +
#bgimg>div {
 +
/* Set rules to fill background */
 +
min-height: 100%;
 +
min-width: 1024px;
 +
 +
/* Set up proportionate scaling */
 +
width: 100%;
 +
height: auto;
 +
position: fixed;
 +
top: 0;
 +
opacity: 0;
}
}
Line 60: Line 73:
}
}
</style>
</style>
 +
<script>
 +
(function($) {
 +
 +
    var fadeInOut = function ($element) {
 +
        var $children = $element.children(),
 +
            current = 0,
 +
            time = 5000,
 +
            speed = '3s';
 +
     
 +
        $children.css({ transition: speed })
 +
                .eq(current).css({ opacity: '1' });
 +
     
 +
        setInterval(function () {
 +
            $children.eq(current).css({ opacity: '0' });
 +
            current = current === $children.length - 1 ? 0 : current += 1;
 +
            $children.eq(current).css({ opacity: '1' });
 +
        }, time);
 +
    };
 +
 +
    fadeInOut($('#bgimg'));
 +
 +
})(jQuery);
 +
</script>
</html>
</html>

Revision as of 09:42, 19 May 2014