[英]How to keep animated div within container
I have 4 tile divs in another container div. 我在另一个容器div中有4个图块div。
When a div is clicked the other 3 disappear. 单击一个div时,其他3个消失。
I'm trying to get the div that was clicked on the fill the container div after it was clicked but its not working out. 我正在尝试获得单击后在填充div上单击的div,但无法正常工作。
How can i get the div to animate towards the empty space left by the divs I minimized? 如何使div朝着我最小化的div留下的空白空间设置动画?
this is my code only difference is the position of the div's since JsFiddle's result window is smaller than my browser: 这是我的代码,唯一的区别是div的位置,因为JsFiddle的结果窗口小于我的浏览器:
<h1 id ='title'>Welcome to TalposMedia</h1>
<div class='navTilesContainer'>
<div id="profile" class="navTile topLeft"><p>Profile</p></div>
<div id="contact" class="navTile topRight"><p>Contact</p></div>
<div id="showcase" class="navTile bottomLeft"><p>Showcase</p></div>
<div id="resume" class="navTile bottomRight"><p>Resume</p></div>
</div>
https://jsfiddle.net/w15ond4L/ https://jsfiddle.net/w15ond4L/
$target.animate({
height : '+=335px',
width : '100%',
top : 0,
left : 0
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.