Hi,

I have a div that appears as you scroll to the bottom of the page and then fades out as you scroll back up. I would like to add a close button to the div which I have done and sort of works. It closes the div, but if you scroll, it appears again.

This is my code:
PHP Code:
function toggle() {
    var 
ele document.getElementById("offerbox");
    var 
text document.getElementById("displayText");
    if(
ele.style.display == "block") {
            
ele.style.display "none";
        
text.innerHTML "show";
      }
    else {
        
ele.style.display "block";
        
text.innerHTML "hide";
    }

$(
document).ready(function(){
 $(
window).scroll(function(){
  
// get the height of #wrap
  
var = $('#wrapper').height();
  var 
= $(window).scrollTop();
  if( 
> (h*.25) && < (h*.75) ){
   
// if we are show keyboardTips
   
$("#offerbox").fadeIn("1000");
  } else {
   $(
'#offerbox').fadeOut('1000');
  }
 });
}) 
Any ideas whats wrong?

Thanks