Team:Heidelberg/js/frontpage
From 2014.igem.org
(Difference between revisions)
Line 1: | Line 1: | ||
- | + | recalcRingSize = function(setPosition) { | |
- | + | ||
var placeholder = $("#img-placeholder"); | var placeholder = $("#img-placeholder"); | ||
var ring = $("#ring"); | var ring = $("#ring"); | ||
var width = placeholder.outerWidth(false); | var width = placeholder.outerWidth(false); | ||
- | var position = placeholder.offset(); | + | if(!setPosition){ |
- | ring.css("width", width | + | var position = placeholder.offset(); |
+ | ring = ring.css(position); | ||
+ | } | ||
+ | ring.css("width", width+"px"); | ||
placeholder.css("height", ring.height()+"px"); | placeholder.css("height", ring.height()+"px"); | ||
+ | }; | ||
+ | |||
+ | $(document).ready(function(){ | ||
+ | skrollr.init(); | ||
+ | recalcRingSize(true); | ||
}); | }); |
Revision as of 09:59, 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); });