"Simon Wigzell" <si**********@s haw.ca> wrote in message
news:RXMuc.6307 89$oR5.263367@p d7tw3no...
Can I trap when the scroll is ended? This is what I want - the calculator
disapears when the site visitor starts scrolling the main page. I'm doing
that with an "onScroll() " function. I'm bringing the calculator back with
a "onMouseup( )" which I thoguht would activate when the scroll bar was
released but it doesn't. What I really want is an "offScroll( )" but there
is no such thing!
http://www.mississippiprinting.com/M...Size=8%20x%209
Nothing to stop it being 'simulated'. Try this - it even has a bandage for
Netscape 4, which doesn't
even have an onscroll event:
<HTML>
<HEAD>
<style>
..slider{positi on:absolute;lef t:20; top:10; border-style:ridge;
border-color:#0000ff; border-width:4px;
background-color:#000080; color:#ffffff; padding:10px; font-weight:bold}
</style>
</HEAD>
<BODY>
<DIV class=slider ID=slide>
Scroll the page & I will hide and stay hidden until the page stops.
</DIV>
<SCRIPT>
// (C)S Chalmers
var delay=null, dr=getDivRef('s lide'), oldVPos=0, scrollInt=null;
function getVPos()
{
var v;
return (v=window.pageY Offset)!=undefi ned ? v :
((v=document.bo dy.scrollTop)!= undefined ? v: 0) ;
}
function moveDiv(dRef)
{
var v=getVPos()
if(dRef)
{
dRef.visibility ='hidden';
clearTimeout(de lay);
delay=setTimeou t("getDivRef('s lide').visibili ty='visible'",8 00);
dRef.top=v+10;
}
}
function getDivRef(divId )
{
return document.getEle mentById
?
document.getEle mentById(divId) .style
:document.layer s
?
document.layers[divId]
:document.all
?
document.all(di vId).style
:null;
}
scrollInt=setIn terval("if(oldV Pos!=getVPos()) {oldVPos=getVPo s();moveDiv(dr) }
",200); //NN4 fix
window.onscroll =function()
{
if(scrollInt!=n ull)
{
clearInterval(s crollInt);
scrollInt=null;
}
moveDiv(dr);
};
//// Page filler only - REMOVE ////
for(var i=0;i<200;i++)
document.write( "|<BR>-<BR>");
///////////////////////////////////////
</SCRIPT>
</BODY>
</HTML>