views:

41

answers:

1

Im pretty unknowledgeable about javascript being desktop application rather a web programmer but I'm trying to add an element to a friends website. Google has failed all my attempts to find a script I can adapt. What I want is a small text box in the bottom right hand corner of the browser window that sits above the html/css, that will disappear if the user scrolls.

could provide a small chunk of javascript that could help? or point me to a script which could be adapted.

thanks

[EDIT] Final Code HTML:

<body onscroll="document.getElementById('textbox').style.display = 'none';" >
<div id="textbox">
Please Scroll down for more information
</div>

CSS

#textbox
{
background-color :#FF732F;
border: solid 1px #5F6800;
padding: 5px;
position: absolute;
z-index: 9999;
right: 0;
bottom:0;
}

[/EDIT]

+3  A: 

To position an element in the bottom-right corner, add the following CSS:

#idOfElement {
    position: absolute;
    z-index: 9999;
    right: 0;
    botom: 0;
}

To make it disappear when the user scrolls, handle the scroll event and write

document.getElementById('idOfElement').style.display = 'none';
SLaks
1) will this make the Element overlay the other HTML/CSS? 2) where does the javascript want to go <HEAD>?
Gwilym