JS,CSS,渐变背景
web前端-js教程
android知乎日报源码,ubuntu系统查看硬件,tomcat自启动最高权限,爬虫繁育商,宝塔面板上传php源码,seo yblzw
运行效果截图如下:美甲会员管理网站源码,ubuntu退出键,tomcat服务器文本乱码,python爬虫考证,php接收大文件上传,台湾seo平台lzw
具体代码如下:业务运营管理系统源码,vscode怎么还原窗口,laptop装Ubuntu,tomcat jvm堆,sqlite在内存中运行,前端三大框架学完大概要多久,爬虫机器人怎样制作的,php获取外网ip,品牌seo搭建流程,学校 html5 网站 案例,淘点金网页版,企业广告公司模板lzw
更多关于JavaScript相关内容感兴趣的读者可查看本站专题:《JavaScript查找算法技巧总结》、《JavaScript动画特效与技巧汇总》、《JavaScript错误与调试技巧总结》、《JavaScript数据结构与算法技巧总结》、《JavaScript遍历算法与技巧总结》及《JavaScript数学运算用法总结》JS配合CSS实现的漂亮渐变背景特效6个实例 var setGradient = (function() { var p_dCanvas = document.createElement('canvas'); var p_useCanvas = !!(typeof(p_dCanvas.getContext) == 'function'); var p_dCtx = p_useCanvas ? p_dCanvas.getContext('2d') : null; var p_isIE = /*@cc_on!@*/ false; try { p_dCtx.canvas.toDataURL() } catch(err) { p_useCanvas = false; }; if (p_useCanvas) { return function(dEl, sColor1, sColor2, bRepeatY) { if (typeof(dEl) == 'string') dEl = document.getElementById(dEl); if (!dEl) return false; var nW = dEl.offsetWidth; var nH = dEl.offsetHeight; p_dCanvas.width = nW; p_dCanvas.height = nH; var dGradient; var sRepeat; if (bRepeatY) { dGradient = p_dCtx.createLinearGradient(0, 0, nW, 0); sRepeat = 'repeat-y'; } else { dGradient = p_dCtx.createLinearGradient(0, 0, 0, nH); sRepeat = 'repeat-x'; } dGradient.addColorStop(0, sColor1); dGradient.addColorStop(1, sColor2); p_dCtx.fillStyle = dGradient; p_dCtx.fillRect(0, 0, nW, nH); var sDataUrl = p_dCtx.canvas.toDataURL('image/png'); with(dEl.style) { backgroundRepeat = sRepeat; backgroundImage = 'url(' + sDataUrl + ')'; backgroundColor = sColor2; }; } } else if (p_isIE) { p_dCanvas = p_useCanvas = p_dCtx = null; return function(dEl, sColor1, sColor2, bRepeatY) { if (typeof(dEl) == 'string') dEl = document.getElementById(dEl); if (!dEl) return false; dEl.style.zoom = 1; var sF = dEl.currentStyle.filter; dEl.style.filter += ' ' + ['progid:DXImageTransform.Microsoft.gradient( GradientType=', +( !! bRepeatY), ',enabled=true,startColorstr=', sColor1, ', endColorstr=', sColor2, ')'].join(''); }; } else { p_dCanvas = p_useCanvas = p_dCtx = null; return function(dEl, sColor1, sColor2) { if (typeof(dEl) == 'string') dEl = document.getElementById(dEl); if (!dEl) return false; with(dEl.style) { backgroundColor = sColor2; }; } } })(); body{font:0.75em/1.4 Arial;text-align:left;margin:20px;} hr{clear:both;visibility:hidden;} xmp{font:12px/12px "Courier New";background:#fff;color:#666; border:solid 1px #ccc;} div.example{ border:solid 1px #555;margin:0 20px 20px 0;float:left; display:inline;margin:1em;background:#fff;width:300px;padding:40px;color:#222;font:xx-small/1.2 "Tahoma";text-align:justify;}CSS特效代码。各类编程源码、精品软件上海世博园我家北京天安门北京欢迎您!setGradient('example1', '#4ddbbe', '#d449cc', 1); setGradient('example2', '#46ddbd', '#d8b617', 0); setGradient('example3', '#c81fc1', '#bf445f', 1); setGradient('example4', '#2285e5', '#d769eb', 0); setGradient('example5', '#8b4286', '#eac87d', 1); setGradient('example6', 'black', 'white', 0);