473,795 Members | 2,840 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
13 16548

"Richard Cornford" <Ri*****@litote s.demon.co.uk> wrote in message
news:c9******** ***********@new s.demon.co.uk.. .
And no support for IE 6 in standards mode.

The OP's site wasn't selecting standards mode, which is difficult to support
for the purposes of setting a div's position. Mozilla requires a string
parameter, including 'px', while Netscape 4 at least, requires an integer.

--
S.C.
Jul 23 '05 #11
Stephen Chalmers wrote:
Richard Cornford wrote:
And no support for IE 6 in standards mode.

The OP's site wasn't selecting standards mode, which is difficult to
support for the purposes of setting a div's position. Mozilla
requires a string parameter, including 'px', while Netscape 4 at
least, requires an integer.


The CSS units problem is not at all difficult to handle:-

<URL: http://jibberingg.com/faq/faq_notes/misc.html#mtCSSUn >

Richard.
Jul 23 '05 #12

"Richard Cornford" <Ri*****@litote s.demon.co.uk> wrote in message
news:ca******** ***********@new s.demon.co.uk.. .
Stephen Chalmers wrote:
Richard Cornford wrote:
And no support for IE 6 in standards mode.

The OP's site wasn't selecting standards mode, which is difficult to
support for the purposes of setting a div's position. Mozilla
requires a string parameter, including 'px', while Netscape 4 at
least, requires an integer.


The CSS units problem is not at all difficult to handle:-

<URL: http://jibberingg.com/faq/faq_notes/misc.html#mtCSSUn >

OK, but another pitfall is that Mozilla doesn't update
document.docume ntElement.scrol lTop, so it's just as well that
window.pageYOff set is still available as it must be used instead.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 strict//EN">
<HTML>
<HEAD>
<style>
..slider{positi on:absolute;lef t:30px; top:20px; 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 until the page stops.
</DIV>

<SCRIPT>
// (C)S Chalmers

function vPosData()
{
this.index=0;
this.v=0;

if( typeof(window.p ageYOffset)!='u ndefined' ) //must test first
this.index=3;
else
if( typeof(document .body.scrollTop )!='undefined' )
this.index=( document.compat Mode &&
document.compat Mode.indexOf("C SS")==0 ) ? 1 : 2;

this.getVPos();
}

vPosData.protot ype.getVPos=fun ction()
{
switch(this.ind ex)
{
case 3: this.v=window.p ageYOffset; break;
case 2: this.v=document .body.scrollTop ; break;
case 1: this.v=document .documentElemen t.scrollTop; break;
case 0: this.v=0;
}

return this.v;
}

var stopWait=null, dr=getDivRef('s lide'), scrollPeriod=nu ll, vp=new
vPosData(), oldVPos=vp.v;

function moveDiv(dRef)
{
if(dRef)
{
dRef.visibility ='hidden';

clearTimeout(st opWait);

stopWait=setTim eout("getDivRef ('slide').visib ility='visible' ",800);

dRef.top=20+vp. getVPos()+(type of(dRef.top)==' string'?'px':0) ;
}
}

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;
}

scrollPeriod=se tInterval("if(o ldVPos!=vp.getV Pos()){oldVPos= vp.getVPos();mo v
eDiv(dr)}",200) ; //NN4 fix

window.onscroll =function()
{
if(scrollPeriod !=null)
{
clearInterval(s crollPeriod);
scrollPeriod=nu ll;
}
moveDiv(dr);
};
//// Line generator only - REMOVE ////
for(var i=0, repeatCount=100/document.locati on.href.length;
i<repeatCount;i ++)
for(var j=0; j<document.loca tion.href.lengt h;j++)
document.write( document.locati on.href.charAt( j)+"<BR>");
///////////////////////////////////////
</SCRIPT>

</BODY>
</HTML>

--
S.C.
Jul 23 '05 #13
Stephen Chalmers wrote:
Richard Cornford wrote:
Stephen Chalmers wrote:
> Richard Cornford wrote:
>> And no support for IE 6 in standards mode.
>>
> The OP's site wasn't selecting standards mode, which is difficult
> to support for the purposes of setting a div's position. Mozilla
> requires a string parameter, including 'px', while Netscape 4 at
> least, requires an integer.


The CSS units problem is not at all difficult to handle:-

<URL: http://jibberingg.com/faq/faq_notes/misc.html#mtCSSUn >

OK, but another pitfall is that Mozilla doesn't update
document.docume ntElement.scrol lTop, so it's just as well that
window.pageYOff set is still available as it must be used instead.


Opera 7, Konqueror 3, Safari 1, IceBrowser 5 and others don't either so
pageX/YOffset should be preferred (and is widely supported outside IE
browsers):-

<URL:
http://jibberingg.com/faq/faq_notes/....html#bdScroll >

Richard.
Jul 23 '05 #14

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
30330
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
1785
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
3211
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
6487
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
9673
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
10448
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
10217
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...
0
10003
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
9046
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
7544
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
6784
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();...
0
5440
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...
3
2922
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.