nobody has been able to crack this one |
nobody has been able to crack this one |
prongs4lily |
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? |
John Pozadzides |
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?
|
pandy |
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.
|
Frederiek |
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.
|
pandy |
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?
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. |
Frederiek |
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. |
pandy |
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.
|
Darin McGrew |
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). |
pandy |
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.
|
Lo-Fi Version | Time is now: 27th April 2024 - 04:09 AM |