I have a div inside a table which is set to overflow. However, I want the div to scroll down to an anchor inside it.
I've tried the typical page.html#blah (where blah is an anchor inside the div) to no avail.
Anyone have any ideas? Thanks.
I have a div inside a table which is set to overflow. However, I want the div to scroll down to an anchor inside it.
I've tried the typical page.html#blah (where blah is an anchor inside the div) to no avail.
Anyone have any ideas? Thanks.
I forgot to mention that I want this to happen when the page finishes loading. It does work when I use a plain <a> link, but not if I do it onload.
Right now I'm using this.location = "#97", just for testing purposes.
You need something like what is in this script:
http://www.dynamicdrive.com/dynamicindex11/scrollc2.htm
If you are already using it, all you have to do is adapt the language in the moveup() function as an onload event. If not and you don't want to use the whole script, we can probably mod up a mini version of it just to do what you want. I would need more to go on though, like:
PLEASE: Include the URL to your problematic webpage that you want help with.
If you feel comfortable wading through the script to get the info you need, that's fine too.
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
The URL is this... weird, I know, but it's encoded
http://www.purrun.com/ver/RFNDMDM2Mz...yMCwyNDAsMQ==/
Atm I have the hardcoded link (Ir a foto)
Thanks
Nice site.
Sin embargo, images should always have alt text (and a blank alt is very pointless) and ids can't start with a number or symbol.
works for me in Firefox and Opera.Code:window.location.href="http://www.purrun.com/ver/RFNDMDM2MzMuanBnOzMyMCwyNDAsMQ==/#20";
Last edited by Twey; 07-03-2005 at 08:42 AM.
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
As far as I can tell, I was wrong. To get the ability to scroll the pictures to a particular position using part of this script requires using the whole script and no scrollbar, just the script's own controls. Sorry about that. I'll let you know if I have any other ideas. Two things I noticed while trying to make this work were that the page looks fine starting out at the top and that if there was some reason why you wanted the pictures viewed in reverse order, the easiest way would be to reverse their order on the page.
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
Thanks for the compliment. The reason I want it to scroll down to the picture is because it's a pain in the ass to scroll down manually to find the pic to select the next one. I added next/prev buttons though, so it's working now. Not like I wanted it to though, but it's something.
I'm using blank alt just to validate it w/ W3C's HTML Validator
Thanks for the help.
@Twey:
I tried your approach, but for some reason it doesn't work if I use it in an onLoad way. A normal link works, though.
That's strange. Perhaps the images aren't quite loaded? Try using setTimeout().
Using hacks like that to outwit the validator totally defeats the point of validation. The validator doesn't insist on an alt just for the fun of it; alts are required in some text-only browsers to provide a handle to the image.
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
It's working now. I used the following code:
Regarding the alt thing, I know what you mean. I was in such a hurry to validate it that I forgot to add something to the important images. Some images, such as the typical spacer.gif don't really require an alt.Code:window.onload = function() { var anchor = "foto108"; window.location.href = "#"+anchor; }
Thanks for the help, once again.
Bookmarks