Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Feb 2004
    Location
    london
    Posts
    77
    Thanks
    0
    Thanked 0 Times in 0 Posts

    scollLeft in opera

    Anyone know why this simple little script doesn't work in opera.

    Code:
    var Timer;
    
    function ScrollLeft()
    {
      Timer = setInterval("document.getElementById('imagelib_scroller').scrollLeft -= 2", 15);
    }
    function ScrollRight()
    {
      Timer = setInterval("document.getElementById('imagelib_scroller').scrollLeft += 2", 15);
    }
    I know, I know, why can't we just use normal scrollbars I hear the developer massive cry...enter the designer!

    I suspect it may be due to Opera's lack of support for scrollLeft, but according to this page on 'quirksmode' it is supported in opera?

    http://www.quirksmode.org/viewport/compatibility.html

    many thanks,
    99 times out of 10!

  • #2
    Regular Coder
    Join Date
    May 2004
    Location
    Alabama, USA
    Posts
    237
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi spenoir,

    That may not work in Opera unless imagelib_scroller has overflow:auto. If you're going to implement your own scrollbar then you may need to take over scrolling as well. Implement it via clipping or one of the other techniques (simple example).

  • #3
    New Coder
    Join Date
    Feb 2004
    Location
    london
    Posts
    77
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hey Mike,
    This is a horizontal scroller, thats why i'm using the scrollLeft method. Also, the overflow needs to be set to overflow:hidden so that the clip i'm using will work. I am trying to achieve a solution without using scrollbars.

    I'm using this technique:

    http://msconline.maconstate.edu/Tuto...dhtml14-03.htm

    thanks for your help,
    99 times out of 10!

  • #4
    Regular Coder
    Join Date
    May 2004
    Location
    Alabama, USA
    Posts
    237
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That technique is similar to the one described in the link I gave - except, don't use scrollLeft and scrollRight - just move the img with style.left and style.right.


    btw... the animations at the link you gave work for me in Opera 9.01 on WinXP-Pro.
    Last edited by MikeFoster; 09-07-2006 at 01:52 PM. Reason: WFM


  •  

    Posting Permissions

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