ehm, beh, l'effetto che scrolla con la pagina si ottiene con i CSS, con JS si setta soltanto il margin-top ed il pulsante per impostare il display: none;
Codice PHP:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<style type="text/css">
*{
margin: 0;
padding: 0;
}
#Bottomed{
height: 150px;
width: 100%;
position: fixed;
background-color: red;
margin: 0;
}
#Bottomed div{
text-align: right;
height: 20px;
line-height: 20px;
}
</style>
<script type="text/javascript">
window.onload = function(){
var myHeight = 0;
if( typeof( window.innerWidth ) == 'number' ) {
//Non-IE
myHeight = window.innerHeight;
} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
//IE 6+ in 'standards compliant mode'
myHeight = document.documentElement.clientHeight;
} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
//IE 4 compatible
myHeight = document.body.clientHeight;
}
var btm = document.getElementById('Bottomed');
var height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight;
btm.style.marginTop = (myHeight - 150)+"px";
var closing = document.getElementById('Closing');
closing.onclick = function(){
document.getElementById('Bottomed').style.display = 'none';
}
}
</script>
</head>
<body>
<div id="Bottomed">
<div>
<a href="#" id="Closing">
Close X
</a>
</div>
</div>
</body>
</html>