CSS或jQuery悬停效果,增加固定框和显示绝对位置的较大版本
CSS or jQuery hover effect to increase a fixed box and show absolute position larger version
如何使我的颜色框的大小增加(在相同的位置,猜测绝对位置,所以它不影响颜色的其他位置),当你悬停时将显示一个更大的版本的颜色,当你悬停。这会使用背景图像大小吗?
我已经添加了一个图像来测试红色的。
#product_color_select li {
display: inline-block;
width: 30px;
height: 25px;
text-indent: -999999em;
cursor: pointer;
}
/* interior colours */
#product_color_select li.eco-weave {
background-color: #beaaaa;
}
#product_color_select li.aubergine-dream {
background-color: #382643;
}
#product_color_select li.lime-citrus {
background-color: #99a366;
}
#product_color_select li.blue-jazz {
background-color: #435fa1;
}
#product_color_select li.sakura-pink {
background-color: #bf3253;
}
#product_color_select li.hot-chocolate {
background-color: #3b2b28;
}
#product_color_select li.tundra-spring {
background-color: #c5c1d0;
}
#product_color_select li.black-sapphire {
background-color: #131114;
}
#product_color_select li.luscious-grey {
background-color: #7a6772;
}
#product_color_select li.wildberry-deluxe {
background-image: url('http://2015.ambientlounge.com/design/themes/ambientlounge/media/images/swatches/mini/wildberry-deluxe.png');
}
<ul class="fabric-select" id="product_color_select">
<li class=" eco-weave" data-value="742" title="Eco Weave">Eco Weave</li>
<li class=" blue-jazz" data-value="749" title="Blue Jazz">Blue Jazz</li>
<li class=" sakura-pink" data-value="743" title="Sakura Pink">Sakura Pink</li>
<li class="selected luscious-grey" data-value="744" title="Luscious Grey">Luscious Grey</li>
<li class=" lime-citrus" data-value="748" title="Lime Citrus">Lime Citrus</li>
<li class=" hot-chocolate" data-value="741" title="Hot Chocolate">Hot Chocolate</li>
<li class=" black-sapphire" data-value="746" title="Black Sapphire">Black Sapphire</li>
<li class=" wildberry-deluxe" data-value="727" title="Wildberry Deluxe">Wildberry Deluxe</li>
<li class=" tundra-spring" data-value="747" title="Tundra Spring">Tundra Spring</li>
<li class=" aubergine-dream" data-value="745" title="Aubergine Dream">Aubergine Dream</li>
</ul>
在元素的悬停处使用CSS3 scale
属性。希望对你有帮助。
此外,您可以使用transition
属性来添加一些舒缓
#product_color_select li {
display: inline-block;
width: 30px;
height: 25px;
text-indent: -999999em;
cursor: pointer;
vertical-align:top;
}
#product_color_select li:hover{
-webkit-transform:scale(1.2);
-moz-transform:scale(1.2);
transform:scale(1.2);
}
/* interior colours */
#product_color_select li.eco-weave {
background-color: #beaaaa;
}
#product_color_select li.aubergine-dream {
background-color: #382643;
}
#product_color_select li.lime-citrus {
background-color: #99a366;
}
#product_color_select li.blue-jazz {
background-color: #435fa1;
}
#product_color_select li.sakura-pink {
background-color: #bf3253;
}
#product_color_select li.hot-chocolate {
background-color: #3b2b28;
}
#product_color_select li.tundra-spring {
background-color: #c5c1d0;
}
#product_color_select li.black-sapphire {
background-color: #131114;
}
#product_color_select li.luscious-grey {
background-color: #7a6772;
}
#product_color_select li.wildberry-deluxe {
background-image: url('http://2015.ambientlounge.com/design/themes/ambientlounge/media/images/swatches/mini/wildberry-deluxe.png');
}
<ul class="fabric-select" id="product_color_select">
<li class=" eco-weave" data-value="742" title="Eco Weave">Eco Weave</li>
<li class=" blue-jazz" data-value="749" title="Blue Jazz">Blue Jazz</li>
<li class=" sakura-pink" data-value="743" title="Sakura Pink">Sakura Pink</li>
<li class="selected luscious-grey" data-value="744" title="Luscious Grey">Luscious Grey</li>
<li class=" lime-citrus" data-value="748" title="Lime Citrus">Lime Citrus</li>
<li class=" hot-chocolate" data-value="741" title="Hot Chocolate">Hot Chocolate</li>
<li class=" black-sapphire" data-value="746" title="Black Sapphire">Black Sapphire</li>
<li class=" wildberry-deluxe" data-value="727" title="Wildberry Deluxe">Wildberry Deluxe</li>
<li class=" tundra-spring" data-value="747" title="Tundra Spring">Tundra Spring</li>
<li class=" aubergine-dream" data-value="745" title="Aubergine Dream">Aubergine Dream</li>
</ul>
相关文章:
- 如何在Simile展品地图中显示位置
- 在TWebBrowser(谷歌地图)中显示位置,而无需单击按钮
- 如何使用XML中的经度和纬度值在地图上显示位置
- Jquery下拉菜单位于幻灯片上方的一个显示位置
- 谷歌地图 API v3 未正确显示位置
- 必应地图未使用 asp.net MVC 显示位置
- 在地图上显示位置
- 使用移动网络应用程序在iphone地图上显示位置
- 栏杆4:单击链接后如何更改显示位置
- 如何在网站上向用户显示位置(国家)
- 在Firefox中显示位置栏
- 无法使用Javascript在谷歌地图中显示位置详细信息
- 如何在Google Maps Places API上突出显示位置
- 根据弹出窗口的显示位置动态更改弹出窗口的位置
- 拖放时显示位置和合计
- 显示位置的变化在谷歌地图上没有重新加载地图一次又一次
- takto显示位置固定
- 在Google Maps API的标记上显示位置信息
- 使用JavaScript检查是否显示位置栏(适用于Internet explorer)
- 如何修改jQuery输入的显示位置