473,394 Members | 1,960 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Scroll page when reach location

how do i scroll page when i get to a location ...
something like :
<body onLoad="sl()">
<script languge="javascript">
function sl(){
if (document.stopper.y>50)
{
window.scroll(0,100);
}
</script>

then always when the user try to scroll to (0,100) its will be scroll
him to (0,50) or something like

Mar 20 '07 #1
4 2253
On Mar 20, 11:37 am, "Link" <ailo...@gmail.comwrote:
how do i scroll page when i get to a location ...
something like :
<body onLoad="sl()">
<script languge="javascript">
function sl(){
if (document.stopper.y>50)
{
window.scroll(0,100);}

</script>

then always when the user try to scroll to (0,100) its will be scroll
him to (0,50) or something like
Try not writing a web based application.... Writing an application for
the web, and then having it behave unlike any other web application
they have seen, will tend to frustrate the end user. Controlling their
scrolling behaviour definitely fits into the "behaving unlike other
web applications" space.

Why not just place anchors on the page and give them links to the
various locations within the page? If there's something down there you
don't want them to see, then hide it. If you're trying to force them
to deal with a certain section of a page, before letting them
continue, rethink your structure.

My only point is there must be a better way then not letting the user
scroll through a web page that you've given them.

Mar 20 '07 #2
On Mar 20, 6:45 pm, "Tom Cole" <tco...@gmail.comwrote:
On Mar 20, 11:37 am, "Link" <ailo...@gmail.comwrote:
how do i scroll page when i get to a location ...
something like :
<body onLoad="sl()">
<script languge="javascript">
function sl(){
if (document.stopper.y>50)
{
window.scroll(0,100);}
</script>
then always when the user try to scroll to (0,100) its will be scroll
him to (0,50) or something like

Try not writing a web based application.... Writing an application for
the web, and then having it behave unlike any other web application
they have seen, will tend to frustrate the end user. Controlling their
scrolling behaviour definitely fits into the "behaving unlike other
web applications" space.

Why not just place anchors on the page and give them links to the
various locations within the page? If there's something down there you
don't want them to see, then hide it. If you're trying to force them
to deal with a certain section of a page, before letting them
continue, rethink your structure.

My only point is there must be a better way then not letting the user
scroll through a web page that you've given them.

----

well ... its apart of a lesson that i learn in javascript and i just
didnt sucess it ...
but well now i have done it ... like :
<html>
<body onLoad="sl()">
<script languge="javascript">
function sl(){
var y = window.pageYOffset;
if (y<120)
{
window.scroll(0,100);
}
setTimeout('sl()',100);
}
</script>
</html>
its work great for FireFox.... but IE7 (that i tested) does not get
it ... do nothing ... why is it ? how can i make it done ?

Mar 21 '07 #3
On Mar 21, 2:56 pm, "Link" <ailo...@gmail.comwrote:
<html>
<body onLoad="sl()">
<script languge="javascript">
function sl(){
var y = window.pageYOffset;
if (y<120)
{
window.scroll(0,100);}

setTimeout('sl()',100);}

</script>
</html>

its work great for FireFox.... but IE7
<body onscroll="sl()">

....

function sl(){
var y=document.body.scrollTop||window.scrollY
if(y<120)
window.scroll(0,100)
}

Mar 21 '07 #4
On Mar 21, 11:15 pm, "scripts.contact" <scripts.cont...@gmail.com>
wrote:
On Mar 21, 2:56 pm, "Link" <ailo...@gmail.comwrote:
<html>
<body onLoad="sl()">
<script languge="javascript">
function sl(){
var y = window.pageYOffset;
if (y<120)
{
window.scroll(0,100);}
setTimeout('sl()',100);}
</script>
</html>
its work great for FireFox.... but IE7

<body onscroll="sl()">

...

function sl(){
var y=document.body.scrollTop||window.scrollY
if(y<120)
window.scroll(0,100)

}
this code does not working on my IE7 or IE6 ...

Mar 24 '07 #5

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

Similar topics

2
by: lawrence | last post by:
I thought I was fighting a PHP problem, so I asked about this on a PHP list, but they felt it was a Javascript problem, so I'm reposting a bit of the debate here. Could this Javascript, below,...
3
by: Devonish | last post by:
I have a form designed as a Continuous form which displays one record per line. Taking account of the header and footer and the size of the screen, I can display 30 records at a time. I can see...
5
by: MacKenzieMouse | last post by:
Is there an easy way to have the page scroll to the next button? When I populate a drop down list box, I have to use the arrow key or the mouse to scroll down. I would like for the page to be...
6
by: | last post by:
Hi all, I have a long web form on asp.net 2.0. When I go at the bottom and click on submit, a postback occurs and if there are any validation errors (no client-side checking being done), the...
1
by: Wayne Sepega | last post by:
Ultimately what I need is a way to remember the scroll position of the form on a post back. I have a button that posts back to the current form and if there are no errors the form is reproduced, I...
1
by: Raffi | last post by:
Hi, I have an application screen with a CSS scroll area. Users click links in the scroll area which open small popup windows to enter data. When the data is submitted, the popup reloads the...
17
by: =?Utf-8?B?Y2F0aGFyaW51cyB2YW4gZGVyIHdlcmY=?= | last post by:
Hello, I have build a website with approximately 30 html-pages. When I search this website in Google, I see the index.html or home.html on this website, but also other html-pages on this...
6
by: =?Utf-8?B?U2hhcm9u?= | last post by:
I'm using the VScrollBar and set it as follow: m_vScrollBar.Minimum = -19602; m_vScrollBar.Maximum = 0; m_vScrollBar.SmallChange = 1; m_vScrollBar.LargeChange = 1089; m_vScrollBar.Value =...
3
by: sungung | last post by:
Hi group, I want to back orginal scroll postion after reload page. Is it possible? My situation is call popup windows -enter data on popup -close popup -refresh parent page -reload data. As...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
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...
0
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,...
0
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...

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.