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
}
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745638920a4637567.html
评论列表(0条)