program to create a scrolling banner

<!DOCTYPE html>
<html>
<head>
<title></title>
<style type="text/css">
#divhead{
background-color: gray;
height: 200px;
width:300px;
text-align: center;
color: white;
font-size: 20px;
          }

</style>
</head>
<body onscroll="helpyou()">
<div id="divcontainer">
    <div id="divhead">
    <p onclick="divcontainer.style.visibility='hidden'">may i help you</p>

    </div>
         full of the page content

</div>
<script type="text/javascript">
function helpyou(){
tpos=document.body.scrollTop
document.getElementById('divhead').style.position="absolute";

document.getElementById('divhead').style.top=tpos+500;
}



</script>


</body>
</html>

Comments

Blogs