admin管理员组文章数量:1026381
I'm using the following javascript to animate a div, but the div isn't animating... does anyone know what can be?
JavaScript:
<script language="JavaScript">
$(document).ready(function(){
$('#LayoutDiv1').animate({top: "500px"}, 1500); });
</script>
HTML:
<div id="LayoutDiv1">
<img src="images/logo.png">
</div>
CSS:
#LayoutDiv1 {
clear: both;
float: left;
width: 100%;
display: block;
}
I'm using the following javascript to animate a div, but the div isn't animating... does anyone know what can be?
JavaScript:
<script language="JavaScript">
$(document).ready(function(){
$('#LayoutDiv1').animate({top: "500px"}, 1500); });
</script>
HTML:
<div id="LayoutDiv1">
<img src="images/logo.png">
</div>
CSS:
#LayoutDiv1 {
clear: both;
float: left;
width: 100%;
display: block;
}
Share
Improve this question
edited Aug 6, 2012 at 17:02
Wilson Junior
asked Aug 6, 2012 at 16:56
Wilson JuniorWilson Junior
572 silver badges6 bronze badges
2 Answers
Reset to default 7Working Demo : http://jsfiddle/LRuZp/3/
The position property should be specified, when defining top, left, bottom and right properties.
you need to set your div
position to relative
#LayoutDiv1 {
clear: both;
float: left;
width: 100%;
display: block;
position: relative
}
I'm using the following javascript to animate a div, but the div isn't animating... does anyone know what can be?
JavaScript:
<script language="JavaScript">
$(document).ready(function(){
$('#LayoutDiv1').animate({top: "500px"}, 1500); });
</script>
HTML:
<div id="LayoutDiv1">
<img src="images/logo.png">
</div>
CSS:
#LayoutDiv1 {
clear: both;
float: left;
width: 100%;
display: block;
}
I'm using the following javascript to animate a div, but the div isn't animating... does anyone know what can be?
JavaScript:
<script language="JavaScript">
$(document).ready(function(){
$('#LayoutDiv1').animate({top: "500px"}, 1500); });
</script>
HTML:
<div id="LayoutDiv1">
<img src="images/logo.png">
</div>
CSS:
#LayoutDiv1 {
clear: both;
float: left;
width: 100%;
display: block;
}
Share
Improve this question
edited Aug 6, 2012 at 17:02
Wilson Junior
asked Aug 6, 2012 at 16:56
Wilson JuniorWilson Junior
572 silver badges6 bronze badges
2 Answers
Reset to default 7Working Demo : http://jsfiddle/LRuZp/3/
The position property should be specified, when defining top, left, bottom and right properties.
you need to set your div
position to relative
#LayoutDiv1 {
clear: both;
float: left;
width: 100%;
display: block;
position: relative
}
本文标签: javascriptJquery animate function not workingStack Overflow
版权声明:本文标题:javascript - Jquery animate function not working - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745638920a2160622.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论