最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How to slide a div from bottom using pure css or pure javascript - Stack Overflow

programmeradmin2浏览0评论

  • So I have a image in background and an iframe effect showing an ad above. (Hopscotch one is an ad. The flower is the html image)
  • All I am trying to do is to show that ad sliding up from the bottom of the background image. I tried many a things. In search of pure css or pure javascript solution.

The ad should slide from bottom of background image and then get fixed at position at which it is showing. Just a sliding effect from bottom till ad shows.

For example please check ad on this page:-

  • So I have a image in background and an iframe effect showing an ad above. (Hopscotch one is an ad. The flower is the html image)
  • All I am trying to do is to show that ad sliding up from the bottom of the background image. I tried many a things. In search of pure css or pure javascript solution.

The ad should slide from bottom of background image and then get fixed at position at which it is showing. Just a sliding effect from bottom till ad shows.

For example please check ad on this page:-

http://www.thenewsminute./article/united-states-south-india-can-southern-collective-get-us-better-deal-delhi-46501

Share Improve this question asked Jul 27, 2016 at 7:05 Abhishek SharmaAbhishek Sharma 1,4201 gold badge21 silver badges32 bronze badges 1
  • 1 share some relevant code so we can help you better – Mihai T Commented Jul 27, 2016 at 7:20
Add a ment  | 

1 Answer 1

Reset to default 3

i guess this is what you are looking for :

 
.container {
  position:relative;
  overflow:hidden;
  width:300px;
  height:200px;
}  
.img {
  width:100%;
  height:100%;
  background:blue;
}

.slidemeup{
  background:red;
  position:absolute;
  bottom:-50px;;
  height:50px;
  width:100%;
  left:0;
  animation-name:slideup;
  animation-delay:0.5s;
  animation-duration:0.8s;
  animation-fill-mode:forwards;
  animation-timing-function:ease-out;

  
}
@keyframes slideup {
  0%{bottom:-50px}
  100%{bottom:0;}
}
<div class="container">
<div class="img">

</div>
<div class="slidemeup">
SLIDE ME UP
</div>
</div>

i used a div with class img instead of the image. but it should work either way

发布评论

评论列表(0)

  1. 暂无评论