Javascript-форум (https://javascript.ru/forum/)
-   Элементы интерфейса (https://javascript.ru/forum/dom-window/)
-   -   Выдвигающийся див из-за неоткуда!? (https://javascript.ru/forum/dom-window/61882-vydvigayushhijjsya-div-iz-za-neotkuda.html)

SLICEofBIRD 13.03.2016 16:57

Выдвигающийся див из-за неоткуда!?
 
Как сделать так, чтобы див выдвигался из-за неоткуда?
То есть я могу поставить, допустим картинку на середину экрана и плавно передвинуть её на другое место, но как сделать так, чтобы она выезжала как-бы из-за фона. Не используя при этом сливающийся с фоном див с более высоким зет-индексом.
Заранее спасибо!

Dilettante_Pro 14.03.2016 16:05

SLICEofBIRD,
<!DOCTYPE HTML>
<html>
<head>
<title></title>
  <style>
     body {
       background-color: blue; 
    }
    img {
      -webkit-transition:all 3s linear;
      -moz-transition:all 3s linear;
      -o-transition:all 3s linear;
      transition:all 3s linear;       
    }   
  </style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script>
    function showImg() {
        $("#start").css("display", "none");
        $("img").css("top","0");  
    }
</script>
</head>
<body>
  <input id="start" type=button value="Кликни" onclick="showImg();"/>
  <div class="clc" style="position: absolute; width:336px; height:100px; top:50px; left:100px; overflow: hidden;">
      <img style="position: absolute; width:336px; height:76px; top: -76px;" src="http://javascript.ru/forum/images/ca_serenity/misc/logo.gif" alt="" />
  </div>
</body>
</html>


Часовой пояс GMT +3, время: 02:01.