animate dauert 2 mehr params, so dass Sie tun können:
$("a.shift")
.click(function()
{
$("#introOverlay")
.animate({height: 0}, 2000,"linear",function()
{
$(this).remove();
}
)
}
);
Ungeprüfte.
EDIT: Getestet: hier ist die volle Seite, die ich verwendet, die mehr auf der Hand zu 300px make Entfernung erweitert:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript">
//<![CDATA[
$(document).ready(function()
{
$(".shift").click(function()
{
$("#introOverlay")
.animate({height: 300}, 2000,"linear",function()
{
$(this).remove();
})
});
});
//]]>
</script>
</head>
<body>
<a class="shift" href="javascript:void(0)">clickme</a>
<div id="introOverlay" style="background-color:red;height:200px;">overlay</div>
</body>
</html>
Hallo Spender, Das entfernt das Element nicht, wenn die Animation beendet ist. – Martin
Perfekt! Vielen Dank! – Martin