Welcome to Dream.In.Code
Become an Expert!

Join 149,513 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,351 people online right now. Registration is fast and FREE... Join Now!




Preventing automatic scrolling (re-positioning)

 
Reply to this topicStart new topic

Preventing automatic scrolling (re-positioning), the view should stay where the user has it, no automatic scrollig

OutOfRange
22 Jul, 2007 - 11:34 PM
Post #1

New D.I.C Head
*

Joined: 22 Jul, 2007
Posts: 5


My Contributions
Hello!

I have a fixed menu on the top of my page (position:fixed).

Under the menu, there is normal html stuff, including an object
element. When the object element gets updated the browser moves the page upward and the object element gets partially hidden by the fixed menu on the top of the page.

I need to prevent the browser from moving the view. How can this be done according to the strict 1.1 standard.
User is offlineProfile CardPM
+Quote Post

girasquid
RE: Preventing Automatic Scrolling (re-positioning)
23 Jul, 2007 - 09:33 AM
Post #2

Barbarbar
Group Icon

Joined: 3 Oct, 2006
Posts: 1,294



Thanked: 18 times
Dream Kudos: 725
My Contributions
How is the element getting updated?
User is offlineProfile CardPM
+Quote Post

OutOfRange
RE: Preventing Automatic Scrolling (re-positioning)
23 Jul, 2007 - 12:21 PM
Post #3

New D.I.C Head
*

Joined: 22 Jul, 2007
Posts: 5


My Contributions
QUOTE(OutOfRange @ 23 Jul, 2007 - 12:34 AM) *

Hello!

I have a fixed menu on the top of my page (position:fixed).

Under the menu, there is normal html stuff, including an object
element. When the object element gets updated the browser moves the page upward and the object element gets partially hidden by the fixed menu on the top of the page.

I need to prevent the browser from moving the view. How can this be done according to the strict 1.1 standard.


The object element contains normal html/text. It is, actually, anohter page that contains a back-link. When the back-link is pressed it works fine but the containing page scrolls so that the object element is at the top, which is the problem.

I think we could think of the object element as a sort of iframe, in this context. The problem is that activating the object causes the main window to scroll, which it shouldn't do.
User is offlineProfile CardPM
+Quote Post

serializer
RE: Preventing Automatic Scrolling (re-positioning)
23 Jul, 2007 - 03:54 PM
Post #4

D.I.C Head
**

Joined: 25 Jun, 2007
Posts: 108


My Contributions
Please post your code and/or a link to an example of the problem.

--serializer
User is offlineProfile CardPM
+Quote Post

OutOfRange
RE: Preventing Automatic Scrolling (re-positioning)
24 Jul, 2007 - 05:11 AM
Post #5

New D.I.C Head
*

Joined: 22 Jul, 2007
Posts: 5


My Contributions


Problem solved, in part.

In stead of a normal link i need a modified link

<a href="void(0);" onclick="scrollTo(0,0); return false;"> back </a>

To streamline the solution, i would need the y-coordinate of an anchor. This should be trivial but in my Firefox i haven't found any way to read the y-coordinate.

Any suggestions appreciated.




User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/7/09 07:49PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month