0

I'm making a jquery carousel and have a running one, but I need to have the slides at the beginning and end have a gradient fade on them.

How can I do this? - Have a image placed ontop of the holding container? - Have a css gradient on a div at each end of the carousel holder?

Have attached pic of required effect... enter image description here

4

2 回答 2

0

这是一个很棒的渐变工具http://www.colorzilla.com/gradient-editor/

于 2013-06-14T14:51:40.473 回答
0

CSS3 解决方案 - http://jsfiddle.net/UddqU/

从 - http://www.colorzilla.com/gradient-editor/生成的渐变 CSS

HTML

<div id="wrapper">
    <div id="left"></div>
    <div id="right"></div>
</div>

CSS:

body {background:orange;}
#left {float:left; width:25%; height:400px; 

    background: -moz-linear-gradient(left,  rgba(230,240,163,1) 0%, rgba(255,255,255,0) 100%); /* FF3.6+ */
    background: -webkit-gradient(linear, left top, right top, color-stop(0%,rgba(230,240,163,1)), color-stop(100%,rgba(255,255,255,0))); /* Chrome,Safari4+ */
    background: -webkit-linear-gradient(left,  rgba(230,240,163,1) 0%,rgba(255,255,255,0) 100%); /* Chrome10+,Safari5.1+ */
    background: -o-linear-gradient(left,  rgba(230,240,163,1) 0%,rgba(255,255,255,0) 100%); /* Opera 11.10+ */
    background: -ms-linear-gradient(left,  rgba(230,240,163,1) 0%,rgba(255,255,255,0) 100%); /* IE10+ */
    background: linear-gradient(to right,  rgba(230,240,163,1) 0%,rgba(255,255,255,0) 100%); /* W3C */
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e6f0a3', endColorstr='#00ffffff',GradientType=1 ); /* IE6-9 */

}

#right { float:right; width:25%; height:400px; 

    background: -moz-linear-gradient(left,  rgba(255,255,255,0) 0%, rgba(230,240,163,1) 100%); /* FF3.6+ */
    background: -webkit-gradient(linear, left top, right top, color-stop(0%,rgba(255,255,255,0)), color-stop(100%,rgba(230,240,163,1))); /* Chrome,Safari4+ */
    background: -webkit-linear-gradient(left,  rgba(255,255,255,0) 0%,rgba(230,240,163,1) 100%); /* Chrome10+,Safari5.1+ */
    background: -o-linear-gradient(left,  rgba(255,255,255,0) 0%,rgba(230,240,163,1) 100%); /* Opera 11.10+ */
    background: -ms-linear-gradient(left,  rgba(255,255,255,0) 0%,rgba(230,240,163,1) 100%); /* IE10+ */
    background: linear-gradient(to right,  rgba(255,255,255,0) 0%,rgba(230,240,163,1) 100%); /* W3C */
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ffffff', endColorstr='#e6f0a3',GradientType=1 ); /* IE6-9 */

}
于 2013-06-14T14:29:08.510 回答