SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    38911 Basic Bytes Free johnuk's Avatar
    Join Date
    Jul 2008
    Location
    Somerset, England
    Posts
    459
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    scrollIntoView not working in IE8?

    Hey all,

    I working on a project for a client and I need a javascript event to fire the scrollIntoView method to pan the browser to a DIV element at the bottom of the page.

    My function is as follows:-

    Code JavaScript:
    function jumpToOtherProducts()
    {
         var x = document.getElementById("product_canvas");
         x.scrollIntoView(true);
    }

    Ive tested this in FF, Chrome and Safari and works fine, but not IE8. Any ideas what I can do about this?


    Kind regards and thanks!

  2. #2
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    It should work. I tested it here: http://www.quirksmode.org/dom/tests/scrollintoview.html

    But if you want it at the bottom of the page you should remove the "true" argument, as that will align it with the top of the page.

  3. #3
    38911 Basic Bytes Free johnuk's Avatar
    Join Date
    Jul 2008
    Location
    Somerset, England
    Posts
    459
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Raffles View Post
    It should work. I tested it here: W3C DOM tests - scrollIntoView

    But if you want it at the bottom of the page you should remove the "true" argument, as that will align it with the top of the page.
    Thats great help, thanks so much !


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
  •