我希望 JQuery Animate 在展开时将内容下推
有人能看到我在这里做错了什么吗?我希望内容能够展开,并在显示隐藏的 div 时将其下方的页脚向下推。这里有一个例子。不要介意可怕的颜色: http://www.kerrydean.ca/MATHESON/home5.html
CSS
.valveMenuWraps {
background-color: #990;
margin: 9px;
float: left;
height: 40px;
width: 170px;
overflow: hidden;
padding: 5px;
position: relative;
}
#valveMenu {
background-color: #FFF;
position: relative;
height: 75px;
width: 795px;
left: 4px;
}
HTML
<div id="content">
<div id="picMenu">
<div id="first" class="pics"></div>
<div id="second" class="pics"></div>
<div id="third" class="pics"></div>
<div id="fourth" class="pics" ></div>
</div><!--end of pic menu-->
<div id="valveMenu">
<div id="controlWrap" class="valveMenuWraps">
<div id="control" style="position:relative">
<p>
vee ball<br />
butterfly control<br />
rotary eccentric plug<br />
globe
</p>
</div></div>
<div id="safteyWrap" class="valveMenuWraps">
<div id="saftey" style="position:relative"></div></div>
<div id="automatedWrap" class="valveMenuWraps">
<div id="automated"></div></div>
<div id="manualWrap" class="valveMenuWraps">
<div id="manual">
<p>soft seated ball valves<br />
high performance butterfly valves<br />
resilinet seated butterfly valves<br />
metal seated ball valve<br />
triple offset butterfly valves<br />
multi-port ball valves<br />
gate, globe, check valves<br />
specialty check valves<br />
knife gate valves<br />
diaphram valves<br />
pinch valves</p>
</div></div>
</div><!--end of valveMenu-->
<div id="footer"><a href="test.html">HOME</a> | <a href="test.html">CONTACT US</a></div>
</div><!--end of content-->
和jQuery
$(document).ready(function(){
//When mouse rolls over
$("#controlWrap").mouseover(function(){
$(this).stop().animate({height:'150px'},{queue:false, duration:600, easing: 'easeOutBounce'})
});
//When mouse is removed
$("#controlWrap").mouseout(function(){
$(this).stop().animate({height:'50px'},{queue:false, duration:600, easing: 'easeOutBounce'})
});
});
谢谢!这个网站太棒了!
Can anyone see what I've done wrong here? I want the content to expand and push the footer below it down when it reveals the hidden div. Here an example. Don't mind the awful colors:
http://www.kerrydean.ca/MATHESON/home5.html
CSS
.valveMenuWraps {
background-color: #990;
margin: 9px;
float: left;
height: 40px;
width: 170px;
overflow: hidden;
padding: 5px;
position: relative;
}
#valveMenu {
background-color: #FFF;
position: relative;
height: 75px;
width: 795px;
left: 4px;
}
HTML
<div id="content">
<div id="picMenu">
<div id="first" class="pics"></div>
<div id="second" class="pics"></div>
<div id="third" class="pics"></div>
<div id="fourth" class="pics" ></div>
</div><!--end of pic menu-->
<div id="valveMenu">
<div id="controlWrap" class="valveMenuWraps">
<div id="control" style="position:relative">
<p>
vee ball<br />
butterfly control<br />
rotary eccentric plug<br />
globe
</p>
</div></div>
<div id="safteyWrap" class="valveMenuWraps">
<div id="saftey" style="position:relative"></div></div>
<div id="automatedWrap" class="valveMenuWraps">
<div id="automated"></div></div>
<div id="manualWrap" class="valveMenuWraps">
<div id="manual">
<p>soft seated ball valves<br />
high performance butterfly valves<br />
resilinet seated butterfly valves<br />
metal seated ball valve<br />
triple offset butterfly valves<br />
multi-port ball valves<br />
gate, globe, check valves<br />
specialty check valves<br />
knife gate valves<br />
diaphram valves<br />
pinch valves</p>
</div></div>
</div><!--end of valveMenu-->
<div id="footer"><a href="test.html">HOME</a> | <a href="test.html">CONTACT US</a></div>
</div><!--end of content-->
and the jQuery
$(document).ready(function(){
//When mouse rolls over
$("#controlWrap").mouseover(function(){
$(this).stop().animate({height:'150px'},{queue:false, duration:600, easing: 'easeOutBounce'})
});
//When mouse is removed
$("#controlWrap").mouseout(function(){
$(this).stop().animate({height:'50px'},{queue:false, duration:600, easing: 'easeOutBounce'})
});
});
thanks! this site is awesome!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我在 #content 和 #footer 中添加了一个 float:left ,它工作得很好。
I added a float:left to both #content and #footer and it works fine.
您需要做几件事。将 #valveMenu 的 CSS 更改为
This 应使其下推页脚。
我删除了高度。并添加了溢出。
You'll need to do a couple of things. Change the CSS for #valveMenu to
This should make it push down the footer.
I removed the height. And added overflow.