https://github.com/micmro/cross-browser-linear-gradient-jquery-css-hook
Prototype of a cross browser jQuery CSS hook that falls back to Microsofts filter gradient (IE6-8) or SVG (e.g. IE9) if CSS3 gradients are not supported. It also handels Webkit's old gradient syntax (still used on a lot of mobile devices).
https://github.com/micmro/cross-browser-linear-gradient-jquery-css-hook
Last synced: about 1 year ago
JSON representation
Prototype of a cross browser jQuery CSS hook that falls back to Microsofts filter gradient (IE6-8) or SVG (e.g. IE9) if CSS3 gradients are not supported. It also handels Webkit's old gradient syntax (still used on a lot of mobile devices).
- Host: GitHub
- URL: https://github.com/micmro/cross-browser-linear-gradient-jquery-css-hook
- Owner: micmro
- Created: 2012-04-27T01:11:33.000Z (about 14 years ago)
- Default Branch: master
- Last Pushed: 2012-05-13T23:11:13.000Z (about 14 years ago)
- Last Synced: 2025-03-27T08:11:25.481Z (about 1 year ago)
- Language: JavaScript
- Homepage: http://michaelmrowetz.com/lab/gradient/indexLinear.htm
- Size: 156 KB
- Stars: 2
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This project is based on:
Tom Ellis' Linear and Radial Gradient cssHook for jQuery (https://github.com/brandonaaron/jquery-cssHooks)
and uses webtoolkit's base64 encoding for the encoding it's SVG background gradients (http://www.webtoolkit.info/)
- I am still working on implementing degree for SVG
- linear-gradient (with all it's prefixes)
Most of this logic is from Tom Ellis, I just added the webkit legacy support for the old webkit-only gradient
syntax as a lot of mobile devices still use older webkit versions.
- Using Filter (IE6-IE8):
Ms' Filter only support 2 colors, theirfore it will only pick up the first and last color in your gradient.
Furthermore it only supports only horizontal and vertical gradients.
- SVG (IE9 and some older Opera version)
SVG has some advantages over filter (more colors, support for rounded corners etc.)
however as IE does not have a method like window.btoa() to base64 encode a string I am
using webtoolkit's base64 encoding.