Team:Heidelberg/js/frontpage

From 2014.igem.org

Revision as of 13:56, 22 September 2014 by Maexlich (Talk | contribs)

recalcRingSize = function(setPosition) { var placeholder = $("#img-placeholder"); var ring = $("#ring"); var width = placeholder.outerWidth(false); var position = placeholder.offset(); if(!setPosition){

 ring.css(position);

} ring.attr("data-start", "transform:rotate(0deg);left:"+position.left+"px"); ring.css("width", width+"px"); placeholder.css("height", ring.height()+"px"); };

$(document).ready(function(){

  $("#ring").load(function(){
     recalcRingSize(true);
     $("#img-placeholder img").css("display", "none");
     $("#ring").css("visibility", "");
     skrollr.get().refresh();
  });
  skrollr.init();

});

$( window ).resize(function() { recalcRingSize(false); skrollr.get().refresh(); });