Skip to content

Instantly share code, notes, and snippets.

@shaneriley
Created June 7, 2013 14:50
Show Gist options
  • Save shaneriley/5729805 to your computer and use it in GitHub Desktop.
Save shaneriley/5729805 to your computer and use it in GitHub Desktop.
$().cssGradient
$.fn.cssGradient = function(start, end) {
end = end || start;
if (!start) { return this; }
return this.css({
"background-image": "-moz-linear-gradient(100% 100% 90deg, " + end + ", " + start + ")",
"background-image": "-webkit-gradient(linear, 0% 0%, 0% 100%, from(" + start + "), to(" + end + "))",
"-ms-filter": "progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=" + start + ", endColorstr=" + end + ")"
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment