我试图让我的引导站点中的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>
Run Code Online (Sandbox Code Playgroud)
......这是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);
}
Run Code Online (Sandbox Code Playgroud)
这是我想要在悬停时发生的一个例子(参见四个小部件框ATF):http://themeforest.net/item/flatnica-ultimate-flat-template/full_screen_preview/5343665
显然,颜色会发生变化,但即使这样也不会根据我为CSS过渡设置的参数而改变.
谢谢!