日期:2014-05-16 浏览次数:20359 次
<script src="jquery-1.4.2.min.js"></script>
<script>
function hid(){
$("#d1").animate({left:"100px"})
}
</script>
<table><tr ><td id="d1" style="position: relative; width: 100px; height:100px;border: 1px solid #0050D0;background: #96E555; cursor: pointer">123</td><td>abc</td></tr></table>
<input type="button" onClick="hid()">
<table>
<tr >
<td style="position: relative; width: 100px; height:100px;border: 1px solid #0050D0;background: #96E555; overflow:hidden; cursor: pointer">
<div id="d1" style="position:absolute; left:0px; width:100%; height:100%;">123</div>
</td>
<td>abc</td>
</tr>
</table>
function hid(){
$("#d1").animate({left:"-100px"});
}
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<style>
body{margin:0px}
</style>
<script>
function hid() {
$("#d1").animate({ "margin-left": "-102px" });
}
</script>
<table id="d1" cellpadding="0" cellspacing="0"><tr ><td style="position: relative; width: 100px; height:100px;border: 1px solid #0050D0;background: #96E555; cursor: pointer">123</td><td>abc</td></tr></table>
<input type="button" onClick="hid()">