The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> nobody has been able to crack this one
prongs4lily
post Mar 18 2007, 07:29 PM
Post #1





Group: Members
Posts: 1
Joined: 18-March 07
Member No.: 2,244



I've asked loads of people now and nobody's managed to help me fix it yet...

I'm using this tag to make a div's scrollbar move to the top:

<div id="scroll"> <p id="top">blah blah blah</p> <!-- more content --> <a href="#top">Top</a></div>

When you click on the 'Top' link it does send the div's scrollbar back to the top.
However, it also sends the main window's scrollbar to the bottom. I'm guessing this is just browser behaviour but does anyone know how I can stop this happening?

I've already tried changing the link to # instead of #top so it'll just reload the page but, for some reason, this doesn't send the div's scrollbar back to the top.

Any suggestions?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
John Pozadzides
post Mar 18 2007, 07:38 PM
Post #2


WDG Founder
******

Group: Root Admin
Posts: 529
Joined: 3-August 06
From: Magnolia, TX
Member No.: 2



I'm kind of following you, but can't really quite imagine what you're explaining. Can you post a URL to the actual page in question?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Mar 18 2007, 08:59 PM
Post #3


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,732
Joined: 9-August 06
Member No.: 6



He has a fixed size div with overflow: auto and wants it to act as a window so he can link to an anchor within that div and make it scroll without this affecting the main window. That's not possible with HTML. Possibly it is with JavaScript, but I don't know how to do it. huh.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Frederiek
post Mar 19 2007, 03:46 AM
Post #4


Programming Fanatic
********

Group: Members
Posts: 5,146
Joined: 23-August 06
From: Europe
Member No.: 9



It does seem to work (in my browser (Safari) anyway), using the usual named anchor, instead of a, for this purpose inappropriate, P element.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Mar 19 2007, 01:37 PM
Post #5


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,732
Joined: 9-August 06
Member No.: 6



Why is that inappropriate? blink.gif

Are you sure you included enough content above the scrolling DIV to make it necessary for the window to scroll to put the id/name at top? All browsers on Windows do the same thing and I kinda think that's the right thing to do.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Frederiek
post Mar 20 2007, 03:46 AM
Post #6


Programming Fanatic
********

Group: Members
Posts: 5,146
Joined: 23-August 06
From: Europe
Member No.: 9



Yep, you're right. I did put quite some content above, but apparently not enough, so I tried again, with the same result as you.
And, I never knew that even a P would work as anchor. One's never too old to learn. biggrin.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Mar 20 2007, 08:58 AM
Post #7


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,732
Joined: 9-August 06
Member No.: 6



Yeah, any id within BODY. Not Netscape safe, of course, but apart from that it's a beaut as my aussie friend says. biggrin.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Mar 20 2007, 12:24 PM
Post #8


WDG Member
********

Group: Root Admin
Posts: 8,365
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



QUOTE
Not Netscape safe
Specifically, not NN4 safe. Newer versions of NN use the Gecko engine (like Firefox, only different).
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Mar 20 2007, 04:17 PM
Post #9


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,732
Joined: 9-August 06
Member No.: 6



Picky picky picky. rolleyes.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 27th April 2024 - 04:09 AM