Results 1 to 10 of 10

Thread: scrolling + div overflow

  1. #1
    Join Date
    May 2005
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default scrolling + div overflow

    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.

  2. #2
    Join Date
    May 2005
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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.

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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

  4. #4
    Join Date
    May 2005
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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

  5. #5
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    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.
    Code:
    window.location.href="http://www.purrun.com/ver/RFNDMDM2MzMuanBnOzMyMCwyNDAsMQ==/#20";
    works for me in Firefox and Opera.
    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!

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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

  7. #7
    Join Date
    May 2005
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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.

  8. #8
    Join Date
    May 2005
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    @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.

  9. #9
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Post

    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!

  10. #10
    Join Date
    May 2005
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    It's working now. I used the following code:

    Code:
    window.onload = function() {
        var anchor = "foto108";
    
        window.location.href = "#"+anchor;
    
    }
    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.


    Thanks for the help, once again.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •