日期:2014-05-17  浏览次数:21045 次

让弹出div从中间慢慢变大
让弹出div从中间慢慢变大,
求教怎么做啊!

------解决方案--------------------

<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<style type="text/css">
#fly{
    width:100px;
    height:100px;
    position:absolute;
    background:#99ff99;
    z-index:100;
    top:200px;
}
</style>

<SCRIPT type="text/javascript">
<!--
$(function () {
var $win= $(document.body),
left= ($win.width()-100)/2,
top= ($win.height()-100)/2;

$("<div id='fly'>Click Me</div>")
.appendTo($win)
.css("left",left)
.css("top",top)
.on("click",function () {
$(this).animate({
top:0,
left:0,
width:$win.width(),
height:$win.height()
})
});
});


//-->
</SCRIPT>