简体   繁体   中英

Jquery Fade Gradient Background

i'm trying to look a way to fade gradient background. I've used the color plugin and i can fade single colors background, or JqueryUI that can highlight the background but i can't find a way to fade gradient backgrounds. Anyone have any idea how to do it ?

.bg1
    {
     background:#f39d1a;
     background:-moz-radial-gradient(50% 0% 164deg,circle closest-corner, #F39D1A, #D98C15);
     background:-webkit-gradient(radial, 50% 0, 800, 50% 0, 300, from(#DA8C16), to(#F39D1A));
    }
.bg2
    {
     background:#06327b;
     background:-moz-radial-gradient(50% 0% 164deg,circle closest-corner, #032358, #06327b);
     background:-webkit-gradient(radial, 50% 0, 800, 50% 0, 300, from(#032358), to(#06327b));
    }

Example... animate a div that has the bg1 element to the bg2 element.

Thanks

Webkit is not there quite yet. But it looks like they have come pretty far.

https://bugs.webkit.org/show_bug.cgi?id=21725

Recently commited changelist of interest.

http://trac.webkit.org/changeset/102388

A workaround could be to use a gradient that fades from transparent to a color. Put that on top of a non-gradient element upon which you actually can perform a color animation. That said, I'm not sure that would satisfy your needs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM