Question

How to scroll down or up to specific Y-px position in opera mini mobile browser on the page without using any 3rd libraries just pure js? Tried everything possible from scrollTo to SCrollInto View nothing works. Help please.

Was it helpful?

Solution 2

From the Opera doc, below the Unsupported DOM events section you will find:

As you can see, key events such as keypress and keyup are not supported. Neither are touch and scroll events.

So scroll events are not supported in Opera Mini. See Other References

OTHER TIPS

The scroll behavior is true as in every modern browser.

When you just open the new window/tab and don't touch screen the javascript scroll API via window.scrollTo(x,y) works fine because you did't signaled the browser where do you want to scroll.

But if you init scroll event (for example swipe) when your page loading the browser will ignore javascript scroll API for example scrollTo. And if you will refresh the page the javascript scroll API will be not work. Because it's a good practice to return user on that page place where user was before refresh.

Also hash bookmarks can scroll the page. If you set a #bookmark to the page URL, the page will scroll to bookmark until you scroll the page. And then you scroll all will be like I wrote upper: javascript scroll API will be ignored.

But there is one way to scroll in any case - manipulate with hash bookmarks:

window.scrollTo(0, 500);//will not work if the user scroll the page
location.hash = '';//reset hash
setTimeout(function () {
    location.hash = 'bookmark';//will scroll to bookmark in any case
}, 1000)//remember about operamini timers limit

It works so because use must control the page, not it's code.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top