Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function svgradient(start, end) {
- var svg = '<?xml version="1.0" ?>\n<svg xmlns="http://www.w3.org/2000/svg"><defs><linearGradient id="gr" x1="0%" y1="0%" x2="0%" y2="100%"><stop offset="0%" style="stop-color:' + start + '"/><stop offset="100%" style="stop-color:' + end + '"/></linearGradient></defs><rect x="0" y="0" width="100%" height="100%" style="fill:url(#gr)"/></svg>';
- //return 'data:image/svg+xml;base64,' + $.base64Encode(svg) //need jQuery and Base64 plugin
- return 'data:image/svg+xml,' + svg
- }
- //example:
- if ($.browser.opera() == true) {
- $('#header').css({'background': 'url("' + svgradient('#eeeeec', '#d3d7cf') + '")'});
- $('#footer').css({'background': 'url("' + svgradient('#d3d7cf', '#eeeeec') + '")'});
- }
Add Comment
Please, Sign In to add comment