我有一个非常奇怪的问题,我有一些如下的标记:
<i id="battery-status-icon" class="icon icon-megaphone-1"></i>
css如下所示:
[class^="icon-"]:before, [class*=" icon-"]:before {
font-family: "custom_icons";
font-style: normal;
font-weight: normal;
speak: none;
display: inline-block;
text-decoration: inherit;
width: 1em;
margin-right: .2em;
text-align: center;
/* opacity: .8; */
/* For safety - reset parent styles, that can break glyph codes*/
font-variant: normal;
text-transform: none;
/* fix buttons height, for twitter bootstrap */
line-height: 1em;
/* Animation center compensation - margins should be symmetric */
/* remove if not needed */
margin-left: .2em;
/* you can be more comfortable with increased icons size */
/* font-size: 120%; */
/* Uncomment for 3D effect */
/* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
}
.icon-megaphone-1:before { content: '\e894'; } /* '' */
.icon-progress-0:before { content: '\e899'; } /* '' */
现在,如果我使用jquery更改图标
$('#battery-status-icon').removeClass('icon-megaphone-1').addClass('icon-progress-0');
然后,新图标的渲染需要一段时间,大约10秒钟左右。在Firefox和其他浏览器中,它就像一个魅力。我们如何在Chrome中修复此问题?