小编MKA*_*Aka的帖子

如何使用CSS去饱和div的背景图像?

我看到这么多的插件去了一个图像去饱和 标签.

但我没有找到任何去饱和背景图像的东西,(一个用作元素背景的图像(div).

有没有办法在悬停时使用2个背景去饱和背景图像(即图像精灵一个是B&W,另一个是颜色)

我可以使用Image Sprites做这样的事情.

// Initially color Image    
$(<element>).mouseover(function(e){

                    jQuery(this).children(":first").stop().animate(
                    {
                        'background-position': <some coordinates>
                        // Coordinates of b&w Image  
                    },
                    100                       
                    );

                    e.stopPropagation();
                })
                .mouseout(function(e){

                    jQuery(this).children(":first").stop().animate(
                    {
                        'background-position': <some coordinates>
                          // Coordinates of color Image   
                    },
                    100,
                    settings.easingType
                    );

                    e.stopPropagation();
                });
Run Code Online (Sandbox Code Playgroud)

但我不想要这个.我想要飞行中的饱和背景图像.请帮忙.

html javascript html5 css3

6
推荐指数
1
解决办法
4321
查看次数

伪元素停止事件点击

我正在使用 css :after属性自定义选择框。

网页:

<div class="styled">
    <select>
        <option>India, Rupees (Rs.)</option>
        <option>USA, Dollars ($) </option>
        <option>United Kingdom, Pounds (&#163;)</option>

    </select>
</div>
Run Code Online (Sandbox Code Playgroud)

CSS:

div.styled{

    display: inline-block;

    float: left;

    position: relative;

    border-right: 1px solid #CCC;

    border-radius: 3px;

    box-shadow: 1px 1px 1px #ddd;

}
.styled select option{

    padding: 5px;

}

div.styled:after{

    content: "";

    background: #fff url("dn_arw.png") no-repeat 2px 4px; 

    display: inline-block;

    float: left;

    height: 18px;

    position: absolute;

    right: 8px;

    top: 6px;

    width: 15px;

}
Run Code Online (Sandbox Code Playgroud)

下面是图像和js小提琴

http://jsfiddle.net/CtYnt/

问题是与“向下箭头图像”重叠的区域不可点击

html css css-selectors

3
推荐指数
1
解决办法
736
查看次数

标签 统计

html ×2

css ×1

css-selectors ×1

css3 ×1

html5 ×1

javascript ×1