<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>table</title>
<link href="http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="css/bootstrap-table.css">
<link rel="stylesheet" href="css/test.css">
<style type="text/css">
div{width:100%;height:100px;text-align:center;line-height:100px;background:#3d4d66;transform:translateX(100%);transition:all 0.8s;color:#fff;}
.in{transform:translateX(0)}
</style>
</head>
<body onload="addclass()">
<div>this is content</div>
<script>
function addclass(){
document.querySelector("div").classList.add("in")
}
</script>
</body>
</html>
页面未加载时,用transform:translateX(100%);把div定位到右边隐藏,当页面加载的时候,增加in class,
.in{transform:translateX(0)},translateX从100% 到 0转变,增加过度时间0.8s完成,transition:all 0.8s;