Team:Heidelberg/js/frontpage
From 2014.igem.org
(Difference between revisions)
Line 14: | Line 14: | ||
skrollr.init(); | skrollr.init(); | ||
recalcRingSize(true); | recalcRingSize(true); | ||
+ | }); | ||
+ | |||
+ | $( window ).resize(function() { | ||
+ | recalcRingSize(false); | ||
}); | }); |
Revision as of 10:01, 22 September 2014
recalcRingSize = function(setPosition) { var placeholder = $("#img-placeholder"); var ring = $("#ring"); var width = placeholder.outerWidth(false); if(!setPosition){
var position = placeholder.offset(); ring = ring.css(position);
} ring.css("width", width+"px"); placeholder.css("height", ring.height()+"px"); };
$(document).ready(function(){ skrollr.init(); recalcRingSize(true); });
$( window ).resize(function() { recalcRingSize(false); });