Scrolling in Opera?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Scrolling in Opera?

PragueExpat
Has anyone else had the problem of Opera not scrolling when using the ScrollTo in interface?

(By the way, Stefan and Paul, thanks for your work on interface - I use it a lot)

My page has a lot of  and  anchors and I wanted to use the ScrollToAnchors method in interface. Since the method looks for elements to scroll to (not named anchors), I made this (small) change to the method:

ScrollToAnchors : function(speed, axis, easing) {
                        return this.each(
                                function()
                                {
                                        jQuery(this).click(
                                                function(e)
                                                {
                                                        parts = this.href.split('#');
                                                        jQuery('a[@name='+parts[1]+']').ScrollTo(800);
                                                        return false;
                                                }
                                        );
                                }
                        )
                }

and used this in the document ready:

$('a[@href*="#"]').ScrollToAnchors(800);

Works great in FF, IE but not in Opera. I tried a straight ScrollTo function in Opera, which also failed.

Can anyone confirm?
Reply | Threaded
Open this post in threaded view
|

Re: Scrolling in Opera?

PragueExpat
that link in the original post should have been ...has a lot of <a href=#xxx> and <a name=xxx> anchors...

Guess I should preview first :)

PragueExpat wrote
Has anyone else had the problem of Opera not scrolling when using the ScrollTo in interface?

(By the way, Stefan and Paul, thanks for your work on interface - I use it a lot)

My page has a lot of  and  anchors and I wanted to use the ScrollToAnchors method in interface. Since the method looks for elements to scroll to (not named anchors), I made this (small) change to the method:

ScrollToAnchors : function(speed, axis, easing) {
                        return this.each(
                                function()
                                {
                                        jQuery(this).click(
                                                function(e)
                                                {
                                                        parts = this.href.split('#');
                                                        jQuery('a[@name='+parts[1]+']').ScrollTo(800);
                                                        return false;
                                                }
                                        );
                                }
                        )
                }

and used this in the document ready:

$('a[@href*="#"]').ScrollToAnchors(800);

Works great in FF, IE but not in Opera. I tried a straight ScrollTo function in Opera, which also failed.

Can anyone confirm?
Reply | Threaded
Open this post in threaded view
|

Re: Scrolling in Opera? Only works with block elements

PragueExpat
If the target element (to scroll to) is an inline element, Opera will not scroll. FF and IE work correctly. If I change the element to a block element, Opera will work.

Because I wanted to use the existing <a href=#xxx> and <a name=xxx> anchors, this will not work in Opera.

Change the <p> target elements in the interface scrollto demo page to <a> or <span> elements to see what I mean (see the difference between IE/FF and Opera).

Stefan, could you comment on this? Is it a limitation of Opera?

Thanks in advance for any insight...


PragueExpat wrote
that link in the original post should have been ...has a lot of <a href=#xxx> and <a name=xxx> anchors...

Guess I should preview first :)

PragueExpat wrote
Has anyone else had the problem of Opera not scrolling when using the ScrollTo in interface?

(By the way, Stefan and Paul, thanks for your work on interface - I use it a lot)

My page has a lot of  and  anchors and I wanted to use the ScrollToAnchors method in interface. Since the method looks for elements to scroll to (not named anchors), I made this (small) change to the method:

ScrollToAnchors : function(speed, axis, easing) {
                        return this.each(
                                function()
                                {
                                        jQuery(this).click(
                                                function(e)
                                                {
                                                        parts = this.href.split('#');
                                                        jQuery('a[@name='+parts[1]+']').ScrollTo(800);
                                                        return false;
                                                }
                                        );
                                }
                        )
                }

and used this in the document ready:

$('a[@href*="#"]').ScrollToAnchors(800);

Works great in FF, IE but not in Opera. I tried a straight ScrollTo function in Opera, which also failed.

Can anyone confirm?
Reply | Threaded
Open this post in threaded view
|

Re: Scrolling in Opera? Only works with block elements

Brandon Aaron
I just fixed a problem in the offset method in the dimensions plugin
dealing with inline elements in opera. It was setting the .scrollLeft
and .scrollTop properties to the same as .offsetLeft and .offsetTop.
Not sure if it is related or not but thought I would share anyways.

--
Brandon Aaron

On 1/30/07, PragueExpat <[hidden email]> wrote:

>
> If the target element (to scroll to) is an inline element, Opera will not
> scroll. FF and IE work correctly. If I change the element to a block
> element, Opera will work.
>
> Because I wanted to use the existing <a href=#xxx> and <a
> name=xxx> anchors, this will not work in Opera.
>
> Change the <p> target elements in the interface scrollto demo page to
> <a> or <span> elements to see what I mean (see the difference
> between IE/FF and Opera).
>
> Stefan, could you comment on this? Is it a limitation of Opera?
>
> Thanks in advance for any insight...
>
>
>
> PragueExpat wrote:
> >
> > that link in the original post should have been ...has a lot of <a
> > href=#xxx> and <a name=xxx> anchors...
> >
> > Guess I should preview first :)
> >
> >
> > PragueExpat wrote:
> >>
> >> Has anyone else had the problem of Opera not scrolling when using the
> >> ScrollTo in interface?
> >>
> >> (By the way, Stefan and Paul, thanks for your work on interface - I use
> >> it a lot)
> >>
> >> My page has a lot of  #xxx  and   anchors and I wanted to use the
> >> ScrollToAnchors method in interface. Since the method looks for elements
> >> to scroll to (not named anchors), I made this (small) change to the
> >> method:
> >>
> >> ScrollToAnchors : function(speed, axis, easing) {
> >>                      return this.each(
> >>                              function()
> >>                              {
> >>                                      jQuery(this).click(
> >>                                              function(e)
> >>                                              {
> >>                                                      parts = this.href.split('#');
> >>                                                      jQuery('a[@name='+parts[1]+']').ScrollTo(800);
> >>                                                      return false;
> >>                                              }
> >>                                      );
> >>                              }
> >>                      )
> >>              }
> >>
> >> and used this in the document ready:
> >>
> >> $('a[@href*="#"]').ScrollToAnchors(800);
> >>
> >> Works great in FF, IE but not in Opera. I tried a straight ScrollTo
> >> function in Opera, which also failed.
> >>
> >> Can anyone confirm?
> >>
> >
> >
>
> --
> View this message in context: http://www.nabble.com/Scrolling-in-Opera--tf3138253.html#a8714081
> Sent from the jQuery Plugins mailing list archive at Nabble.com.
>
>
> _______________________________________________
> jQuery mailing list
> [hidden email]
> http://jquery.com/discuss/
>

_______________________________________________
jQuery mailing list
[hidden email]
http://jquery.com/discuss/
Reply | Threaded
Open this post in threaded view
|

Re: Scrolling in Opera? Only works with block elements

PragueExpat
It seems to be a problem with the getPosition function in iutil.js. In Opera, it returns 0 for an inline element.

I seem to remember some talk about merging the overlapping functions between dimensions and interface (like finding the position of an element). Is that going to happen? It seems silly to maintain 2 versions of a function that does the same thing.


Brandon Aaron wrote
I just fixed a problem in the offset method in the dimensions plugin
dealing with inline elements in opera. It was setting the .scrollLeft
and .scrollTop properties to the same as .offsetLeft and .offsetTop.
Not sure if it is related or not but thought I would share anyways.

--
Brandon Aaron

On 1/30/07, PragueExpat <pragueexpat@hotmail.com> wrote:
>
> If the target element (to scroll to) is an inline element, Opera will not
> scroll. FF and IE work correctly. If I change the element to a block
> element, Opera will work.
>
> Because I wanted to use the existing  and  name=xxx> anchors, this will not work in Opera.
>
> Change the <p> target elements in the interface scrollto demo page to
>
 or  elements to see what I mean (see the difference
> between IE/FF and Opera).
>
> Stefan, could you comment on this? Is it a limitation of Opera?
>
> Thanks in advance for any insight...
>
>
>
> PragueExpat wrote:
> >
> > that link in the original post should have been ...has a lot of
 > href=#xxx> and  anchors...
> >
> > Guess I should preview first :)
> >
> >
> > PragueExpat wrote:
> >>
> >> Has anyone else had the problem of Opera not scrolling when using the
> >> ScrollTo in interface?
> >>
> >> (By the way, Stefan and Paul, thanks for your work on interface - I use
> >> it a lot)
> >>
> >> My page has a lot of  #xxx  and   anchors and I wanted to use the
> >> ScrollToAnchors method in interface. Since the method looks for elements
> >> to scroll to (not named anchors), I made this (small) change to the
> >> method:
> >>
> >> ScrollToAnchors : function(speed, axis, easing) {
> >>                      return this.each(
> >>                              function()
> >>                              {
> >>                                      jQuery(this).click(
> >>                                              function(e)
> >>                                              {
> >>                                                      parts = this.href.split('#');
> >>                                                      jQuery('a[@name='+parts[1]+']').ScrollTo(800);
> >>                                                      return false;
> >>                                              }
> >>                                      );
> >>                              }
> >>                      )
> >>              }
> >>
> >> and used this in the document ready:
> >>
> >> $('a[@href*="#"]').ScrollToAnchors(800);
> >>
> >> Works great in FF, IE but not in Opera. I tried a straight ScrollTo
> >> function in Opera, which also failed.
> >>
> >> Can anyone confirm?
> >>
> >
> >
>
> --
> View this message in context: http://www.nabble.com/Scrolling-in-Opera--tf3138253.html#a8714081
> Sent from the jQuery Plugins mailing list archive at Nabble.com.
>
>
> _______________________________________________
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
>

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/