以下是一些html,CSS和JavaScript代码:
<Body onload="document.getElementById('Chrome_popup').style = 'position: fixed; left:0; bottom:10%; height:10%; width:100%;';">
<Div id="pop-up" style="position: fixed; left:0; bottom:-10%; height:10%; width:100%;">
Hi
</Div>
</Body>
我希望在打开文档时弹出div。请为我添加转换代码。
答案 0 :(得分:0)
下面的CSS将帮助您:
#pop-up {
-webkit-transition:all .8s ease;
-moz-transition:all .8s ease;
-ms-transition:all .8s ease;
-o-transition:all .8s ease;
transition:all .8s ease;
}
顺便说一句,HTML标签以小写开头,而不是高级标签!使用<body></body>
代替<Body></Body>
#pop-up {
-webkit-transition:all .8s ease;
-moz-transition:all .8s ease;
-ms-transition:all .8s ease;
-o-transition:all .8s ease;
transition:all .8s ease;
}
<body onload="document.getElementById('pop-up').style = 'position: fixed; left:0; bottom:10%; height:10%; width:100%;';">
<div id="pop-up" style="position: fixed; left:0; bottom:-10%; height:10%; width:100%;">
Hi
</div>
</body>