我想让我的Bootstrap站点中的Glyphicons在悬停时旋转(除了更改颜色之外)。
这是我的尝试:http://jsfiddle.net/young_greedo17/88g5P/
...使用以下代码:
<div class="widgetbox">
<br><br>
<div class="icon-calendar icon-large"></div>
<h5>Add an event</h5>
</div>
...这是CSS代码:
.widgetbox {
width: 250px;
height: 250px;
background-color: black;
color: white;
text-align: center;
}
.widgetbox [class*="icon-"] {
-webkit-transition-duration: 1.0s;
-moz-transition-duration: 1.0s;
-o-transition-duration: 1.0s;
transition-duration: 1.0s;
-webkit-transition-property: -webkit-transform;
-moz-transition-property: -moz-transform;
-o-transition-property: -o-transform;
transition-property: transform;
}
.widgetbox:hover [class*="icon-"] {
color: #24a159 !important;
-webkit-transform:rotate(360deg);
-moz-transform:rotate(360deg);
-o-transform:rotate(360deg);
transform:rotate(360deg);
}
这是我希望在悬停时发生的示例(请参见四列小部件框架ATF):http://themeforest.net/item/flatnica-ultimate-flat-template/full_screen_preview/5343665
显然,颜色会变化,但即使如此,它也不会根据CSS中设置的过渡参数进行更改。
谢谢!
.rotate(360)
更改为transform:rotate(360)
,然后它就可以在 SCSS 转换器中解析了。 - eduncan911