使用jQuery渐变填充? [英] Gradient fill using jQuery?

查看:110
本文介绍了使用jQuery渐变填充?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个需要渐变背景的< div> 。但是,div的大小是可变的,这使我回到不能在CSS中的梯度土地。

I've got a <div> that needs a gradient background. However, the size of the div is variable, which lands me back in "can't do gradients in CSS" land.

但是,我很确定这是可能在jQuery中,我只是似乎找不到一个体面的例子。

However, I'm pretty sure this is possible in jQuery, I just can't seem to find a decent example. Does anyone have something they can point my way?

感谢。

推荐答案

p>如果有人需要这个,如果你认为jQuery插件太重,你可以使用

in case that someone needs this, and if you think that the jQuery plugin is too heavy, you can use this

filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00A622', endColorstr='#00B726'); /* for IE */

background: -webkit-gradient(linear, left top, left bottom, from(#00A622), to(#00B726)); /* for webkit browsers */

background: -moz-linear-gradient(top,  #00A622, #00B726); /* for firefox 3.6+ */

这篇关于使用jQuery渐变填充?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆