
<div id="blink">闪烁的文字</div>
<script language="javascript">
function changeColor(){
var color="#f00|#0f0|#00f|#880|#808|#088|yellow|green|blue|gray"
color=color.split("|")
document.getElementById("blink").style.color=color[parseInt(Math.random() * color.length)]
}
setInterval("changeColor()",200)
</script>
你是要刷新整个页面还是仅仅回到button的位置,如果仅仅是回到button位置,像楼上说的直接加锚点,如果是刷新整个页面的同时回到button,要是我的话我会用localtion.href先把本页面button距离页面顶部的距离$('button').offset().top传给服务端,服务端刷新页面,同时把刚才那个button的距顶部的距离传回客户端,用jQuery:$(document).scrollTop(xxx)回到button位置,方法比较笨,仅作参考经测试,采用Firefox 45.0.1存在闪烁问题,并发现以下浏览器的某个版本:微信内置浏览器、QQ浏览器、Safari手机浏览器及早期的Chrome可能存在类似情况,包括载入闪动,悬停后闪动。分析:Blink对transition中,属性transform的动画渲染存在差异,而Chrome中的最新版本,已经不存在此情况。解决方法:<style>.outter { height: 375px margin: 10px auto width: 500px }.inner{}img:hover { width:110% margin-left:-5% margin-top:-5%}img{width:100% transition:0.4s ease-in-out}</style>复制代码以上CSS,在IE10、IE11、Chrome及Firefox 45.0.1中调试通过:首次载入,及Ctrl+F5刷新,均不会有闪动情况欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)