<textarea>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>scroll</title>
<style>
#div1 {height:220px;width:200px;background:red;position:absolute;right:0px;bottom:0px}
body {height:2000px}
</style>
<script>
window.οnscrοll=window.οnresize=function(){
var scrollTop=document.documentElement.scrollTop||document.body.scrollTop;
var oDiv=document.getElementById("div1");
oDiv.style.top=document.documentElement.clientHeight-oDiv.offsetHeight+scrollTop+"px";
};
</script>
</head>
<body>
<div id="div1">
<a οnclick="" href="#">Top</a>
</div>
</body>
</html>
</textarea>