Quantcast
Channel: w3cplus
Viewing all articles
Browse latest Browse all 1557

文档加载完毕再执行transition

$
0
0

首先给body添加preload这个class,然后给所有的元素执行transition为none,最后通过js判断,加载完毕把body上的preload这个class去掉

<body class="preload">
.preload * {
  -webkit-transition: none !important;
  -moz-transition: none !important;
  -ms-transition: none !important;
  -o-transition: none !important;
}
$("window").load(function() {
  $("body").removeClass("preload");
});

更多请查看:http://css-tricks.com/transitions-only-after-page-load/


Viewing all articles
Browse latest Browse all 1557

Trending Articles