Simplest css,js pop-up

51 Views Asked by At

Here is some html,CSS and JavaScript code:

<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>

I want the div to pop-up when document is opened. Please add a transition code for me.

1

There are 1 best solutions below

0
On

The CSS below is going to help you:

#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;
}

By the way, HTML tags start with lowercase, not the upper ones! Use <body></body> instead of <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>