我看到这么多的插件去了一个图像去饱和 标签.
但我没有找到任何去饱和背景图像的东西,(一个用作元素背景的图像(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)
但我不想要这个.我想要飞行中的饱和背景图像.请帮忙.
我正在使用 css :after属性自定义选择框。
网页:
<div class="styled">
<select>
<option>India, Rupees (Rs.)</option>
<option>USA, Dollars ($) </option>
<option>United Kingdom, Pounds (£)</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小提琴
问题是与“向下箭头图像”重叠的区域不可点击