Created
May 12, 2010 00:29
-
-
Save jethrolarson/398059 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery.fn.balls = function(){ | |
return this.each(function(){ | |
var $this = $(this), | |
w = $this.width(), | |
h = $this.height(), | |
max = w > h ? w : h, | |
rad = Math.floor(max/2) + "px"; | |
$this.css({ | |
"width": max, | |
"height": max, | |
"-moz-border-radius": rad, | |
"-webkit-border-radius": rad, | |
"border-radius": rad, | |
"overflow":"hidden" | |
}); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Someone at the office insisted that a balls plugin needed to get made. Well here you go.