473,785 Members | 2,969 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 16546

"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
1580
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
30326
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
18266
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
3744
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
2385
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
1782
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
10257
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
3210
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
6486
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
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10148
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
10091
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
9950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8972
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...
0
6740
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4053
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
3646
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2879
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.