Team:UCLondon/Templates/Team-Style

From 2012e.igem.org

(Difference between revisions)
Line 94: Line 94:
<script>
<script>
 +
 +
jQuery.fn.center = function ($) {
 +
  var w = $(window);
 +
  this.css({
 +
    'position':'absolute',
 +
    'top':Math.abs(((w.height() - this.outerHeight()) / 2) + w.scrollTop()),
 +
    'left':Math.abs(((w.width() - this.outerWidth()) / 2) + w.scrollLeft())
 +
  });
 +
  return this;
 +
}
Line 100: Line 110:
$('.team li').click(function(event) {
$('.team li').click(function(event) {
-
   $('#shadow').css("top", ( $(window).height() - this.height() ) / 2+$(window).scrollTop() + "px");
+
   $('#shadow').center();

Revision as of 05:33, 17 September 2012