473,721 Members | 2,256 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"scroll end" event?

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
Jul 23 '05 #1
13 16540

"Simon Wigzell" <si**********@s haw.ca> wrote in message
news:RXMuc.6307 89$oR5.263367@p d7tw3no...
What I really want is an "offScroll( )" but there is
no such thing!


Think carefully about what you are asking. The process of scrolling
consists of a series of sequential scroll actions, each of which moves the
page by a set amount, and each must end before another can start. What would
determine the triggering of an 'offscroll'even t?
To re-show your div or whatever, you need to monitor the time that the page
displacement has remained the same.
In addition to using the onscroll event to hide the div, it could
set/refresh a timeout for restoring visibility.

--
S.C.
Jul 23 '05 #2
Surely it is possible to trap the "onmouseup" event when the user has
finished "dragging" and "lets go of" the scroll bar? "onmouseup" can be
trapped within the rest of the browser window?
Jul 23 '05 #3
On Tue, 01 Jun 2004 00:53:51 GMT, Simon Wigzell wrote:
Surely it is possible to trap the "onmouseup" event when the user has
finished "dragging" and "lets go of" the scroll bar?


What about when I release..
<http://www.physci.org/kbd.jsp?key=up>
<http://www.physci.org/kbd.jsp?key=pgd n>
<http://www.physci.org/kbd.jsp?key=hom e>..?

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
Jul 23 '05 #4

"Simon Wigzell" <si**********@s haw.ca> wrote in message
news:zsQuc.6324 76$oR5.31064@pd 7tw3no...
Surely it is possible to trap the "onmouseup" event when the user has
finished "dragging" and "lets go of" the scroll bar? "onmouseup" can be
trapped within the rest of the browser window?

Yes, but the scrollbar isn't classed as part of the window (except by
Mozilla).
You may be able to use <body onmouseover=... or the scripted equivalent, but
I would much prefer the way I suggested.
BTW, your current code is not cross-browser, and there is an error in the
CenterIt() function related to the scope of a variable.

--
S.C.
Jul 23 '05 #5
rf

"Simon Wigzell" <si**********@s haw.ca> wrote in message
news:zsQuc.6324 76$oR5.31064@pd 7tw3no...
Surely it is possible to trap the "onmouseup" event when the user has
finished "dragging" and "lets go of" the scroll bar? "onmouseup" can be
trapped within the rest of the browser window?


What if your viewer uses that arrow keys or page down/up keys to scroll?

What if your viewer uses the mouse wheel to scroll?

Cheers
Richard.
Jul 23 '05 #6
DU
Simon Wigzell wrote:
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...ame=Brochures& PageName=8%20x% 209&FIRSTTIME=Y ES&PRODUCT=Full %20Color%20Broc hure&PageSize=8 %20x%209


Your code is far from correct, interoperable and cross-browser. Even if
you choose to support only MSIE, your code as it is does not make a lot
of sense. You never define unit values in your css declarations and that
falls under error conditions in CSS. OTOH, you want to support MSIE when
in standards compliant rendering mode with
var root = (document.compa tMode == "CSS1Compat "?
document.docume ntElement: document.body);
which is desirable but your code is incoherent with such praiseworthy goal.

IMO, you first need to validate your markup code and CSS code before
going any further.

DU
Jul 23 '05 #7
DU
rf wrote:
"Simon Wigzell" <si**********@s haw.ca> wrote in message
news:zsQuc.6324 76$oR5.31064@pd 7tw3no...
Surely it is possible to trap the "onmouseup" event when the user has
finished "dragging" and "lets go of" the scroll bar? "onmouseup" can be
trapped within the rest of the browser window?

What if your viewer uses that arrow keys or page down/up keys to scroll?

What if your viewer uses the mouse wheel to scroll?

Cheers
Richard.


All of these don't matter if you properly set a scroll event listener on
the window.

http://www10.brinkster.com/doctorunc...rollEvent.html

NS 7.0 was supporting
window.addEvent Listener("scrol l", functionName, false)
much better than later releases:
http://bugzilla.mozilla.org/show_bug.cgi?id=35011#c64
http://bugzilla.mozilla.org/show_bug.cgi?id=189308
Opera 7 also had to fix a bug on this.

DU
Jul 23 '05 #8

"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>
Jul 23 '05 #9
Stephen Chalmers wrote:
<snip>
... - it even has a
bandage for Netscape 4, which doesn't
even have an onscroll event:
Fair enough.

<snip> function getVPos()
{
var v;
return (v=window.pageY Offset)!=undefi ned ? v :
But a runtime error ("undefined is undefined") on IE4.
((v=document.bo dy.scrollTop)!= undefined ? v: 0) ;

<snip>

And no support for IE 6 in standards mode.

Richard.
Jul 23 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1576
by: JohnR | last post by:
Wow, this is unbelieveable. I've narrowed it down to a few lines of code. Create a new project in VB.NET and put 2 buttons on it (a FBD button and an EXIT button) and enter these lines for the click events: Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click End End Sub Private Sub btnDoFBD_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDoFBD.Click
1
30307
by: Najm Hashmi | last post by:
Hi all , I am trying to create a store procedure and I get the following error: SQL0104N An unexpected token "END-OF-STATEMENT" was found following "END". Expected tokens may include: "JOIN <joined_table> Explanation: A syntax error in the SQL statement was detected at the specified token following the text "<text>". The "<text>" field indicates the 20 characters of the SQL statement that preceded the token
3
18263
by: Summit | last post by:
Does anyone know what the C# equivalent for VB6 End is? I'm starting up a form with a boolean test. If I fail, I just want to end the app. Even though I close the form, it picks up on the line after the bracket and continues loading the form. Here's my snippet: DalMan._drCurrentUser = DalMan._dtUsers.FindByUserName("Init"); if (DalMan._drCurrentUser == null)
0
3742
by: Tom Bower | last post by:
In the Windows Task Manager if I select a Process and right-click, I can choose to "End Process" or "End Process Tree." Is there a VB equivalent for "End Process Tree" if you have a handle to a process? I know about process.Kill and process.CloseMainWindow, but how would I do the equivalent of "End Process Tree" where any child or associated processes are also killed? How do you know what processes are considered to be part of the...
4
2380
by: Alex Maghen | last post by:
Does a call to Response.Redirect result in an immediate exit from the current page function (i.e. a "return()")? I want to make sure that the statements after the Response.Redirect() do not get called. Alex
3
1777
by: caston | last post by:
Well, everybody can now agree with the fact that the Ajax hype is over. Still multiple Ajax Frameworks are flourishing, aren't they? So, last night I questioned myself with the following: "When Ajax Frameworks will be gone? What is required to get rid of them and start using browsers?" (To be more precise, I should probably also mention what kind of frameworks do i mean. These are: Dojo, BackBase, Qooxdoo etc.) I've got an answer that I...
28
10251
by: kaleolani65 | last post by:
I have been having an ongoing problem with a DB at work concerning people getting "locked out". Access warnings relating to "exclusive" mode The research I have done and the replies received suggest I split the DB (front-end/back-end). A working copy of the DB was split and I can see how the DB (back-end) is being updated. Being such an Access noob (who did not actually build the DB) I don't know what people mean exactly when...
5
3208
by: BA | last post by:
Hi there I am trying to write an "application" in Access 2000, that displays a front end and allows the user to interact with the database without seeing Access loaded, in the background, nor on the taskbar. When I click on the generate report button, from the front-end's form, no report/query is displayed. However, if i disable the code that "hides" Access, the reports and queries work perfectly. How do I get this functionality...
2
6485
by: jahanas | last post by:
Private Sub txtBox1.txtLife_Enter(ByVal frmQuote) Handles txtLife Me.txtQuote.Text = "I like life, it's something to do." End Sub Private Sub txtBox2.txtFuture_Enter(ByVal frmQuote) Handles txtFuture Me.txtQuote.Text = "The future isn't what it used to be." End Sub Private Sub txtBox3.txtTruth_Enter(ByVal frmQuote) Handles txtTruth Me.txtQuote.Text = "Tell the truth and run."
0
8738
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9376
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9230
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9148
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8026
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6678
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4499
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3207
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2596
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.