通过使用jquery,我想从顶部切割一个方形高度。它似乎默认情况下是从底层开始的。我该如何改变它?从顶部更改div的高度
这里有一个小提琴:http://jsfiddle.net/b4wcspy1/
<style>
.square {
height:100px;
width: 100px;
background:black;
position:absolute;
}
</style>
<body>
<div class="square"></div>
<script>
$('div').click(function(){
$(this).css('height','60px')})
</script>
</body>
</html>
所以更改边距顶部 $(本)的.css你可以得到更多的信息( '的margin-top', '40像素'); – Banik 2015-04-03 10:25:14