html - scrollbar jump by itself - html

I'm experiencing this weird problem which my scrollbar jumps by itself to somewhere that I don't want it to.
I have a table with scrollbar inside this page, if the user have a smaller screen, the page automatically adds a scrollbar. If I scroll down to the bottom of the table and click on it, the scrollbar of the page jumps up so I can no longer see the thing I clicked. Any ideas?
Thanks.

There are a number of things that can be causing this.
You clicked on a hyperlink with a href of "#", which will cause most browsers to scroll to the top of the page,
There's possibly a CSS :focus or :active rule somewhere being triggered that causes the height of the page to change
There's a javascript onclick event firing and changing the page
...or possibly something else entirely.
Have you tried in different browsers? It could be a bug in the browser itself.

Are you sure the object causing the problem is not an <a href='#'><div onclick='yourJavaScriptFunction()'>...</div></a> or something similar?

Perhaps you have a meta refresh tag
<meta http-equiv="refresh" content="600">
I have seen these cause similar issues on safari, post a link to the page and you will find getting a solution much easier.

My scrollbar jumps when I hit Page Up or Page Down. Also, my laptop trackpad can cause odd mouse behavior if I bounce my thumb against it.
And when I poured a large Latte into my keyboard, I had problems, then. But then the whole computer stopped working about an hour later.

Related

Chrome auto scroll positon

Over the last couple of weeks or so Chrome seems to have had an update that is making the page resume scrolled down in the middle. Moving between list and form pages on out site it resuming in the middle of the page.
Even basic form pages when you click save it is leaving the page at the bottom so you don't see the standard bootstrap record saved confirmation message at the top.
This is making Chrome unusable for our product demos etc. and causing a massive headache.
I have tried going in to chrome://flags/ and 'Scroll Anchor Serialization' off but had no affect.
I have also tried adding overflow-anchor: none; to the body tag but also didn't help.
Is there any other way of being able to disable Chromes auto scroll resuming on pages so that all pages load at the top of the page. It only seems to be Chrome and only seems to have started happening in the last couple of weeks. We are now getting to the point that Chrome is not usable as a browser on our site when it used to be the most reliable for demos.
In the end we have had to add:
<script type="text/javascript">
window.scrollTo(0, 0);
</script>
To every page which isn't the best solution but it works.

Page jumps to top when scrollbar reaches bottom safari iphone

I'm working on a web application that was not built with responsive design, so the mobile experience is not very good for users. Nonetheless, users still use the site on mobile devices. When a particular page in the app is rendered on a mobile device, a vertical scroll bar appears, which seems to be totally normal (viewing the same page in a desktop browser also has a vertical scroll bar). The issue is that when the user on the mobile device tries to scroll to the bottom to press the submit button, the page jumps back to the very top. More specifically, the user touches and drags the screen so that the bottom of the page comes into view, and as soon as they lift their finger from the screen, the page jumps back to the top, preventing them from being able to press the submit button because it becomes hidden from view. I've hooked up my iPhone 5s to my Mac and used Desktop Safari to set up remote debugging. That hasn't helped much yet. I noticed that changing the device orientation makes the issue go away. More specifically, the issue happens in both portrait and landscape orientation. However, if you load the page in one orientation and then switch to the other orientation, the issue seems to go away. I also noticed that setting an explicit height on one of the container divs in the CSS seems to fix the issue, despite the CSS rule being ultimately overridden by the browser (I think). When I set the height, though, the page renders a little differently because the content seems more zoomed out and no vertical scroll bar appears.
I've searched around the web for a while and have not found anything useful. I found two SO posts about similar issues, and one had no answer and the other had a junk answer that should've been a comment.
Basically what I'm looking for is for someone that has some amount of experience developing for the mobile web to give me some possible avenues to travel down to solve this thing the right way. I don't want a hacky solution and I'm not necessarily looking for you to tell me what code to write. I just want to get to the bottom of what would cause the page to jerk like that.
Thanks in advance :)

Image only shows when resized/selected

So i put up a video on our page http://playgrounddistribution.com
It worked like a charm, until i scrolled down and saw that the image behind the "ABOUT US" section doesn't show until i select it with cmd+a or resize the window. This is rather annoying because the text is white so if the background isn't there you can't read it.
At first i thought the video loaded before the image, so i tried only loading metadata, but that didn't solve the problem. Then i figured it must be the cache, but disabling the cache didn't solve it either. Then i noticed selecting it or resizing the window did the trick, but that isn't optimal for our customers. It only seems to occur in Chrome. Have any of you experienced this problem before or should i include the css?
Screenshots here: http://imgur.com/a/xARmi
Thanks in advance!

Repaint time from 0 to 8ms, Chrome still not scrolling smoothly

First of all, let me explain what I mean by "smooth scrolling" here. When I rotate the mouse wheel by one "step", e.g. on Google Search results page, the page gradually moves up/down - the transition from the "before scroll" to "after scroll" states takes some time and is nicely animated. However, whenever I create a long page in html and try to scroll just one "step", there is no animation or transition on scroll - the page just instantly jumps few lines up or down. The average repaint time of my page takes about 5ms, with peaks up to 8ms, so I know repaint time is not the cause of that.
I know that such smooth scrolling can be achieved without any scripting, as for example the site http://www.thecssninja.com/ scrolls super-smooth on Chrome even with js disabled.
Why does Chrome choose not to scroll my page smoothly? How do I achieve smooth scroll without depending on JS, as CSS Ninja manages to?
PS Firefox does not seem to have that issue. How do I tell Chrome with my html/css that I'd like my page to scroll smoothly?
Either you can enable chrome smooth scrolling manually, which does not make sense for website development.
Or you can use some of the libraries to achieve that.
https://github.com/fatlinesofcode/jquery.smoothwheel
Sadly for chrome you cannot enable smooth scrolling through HTML, CSS or JS.
I know you're not after JS solutions, but I've never seen anything guarantee this outside of JavaScript, and karan's link above is certainly the smoothest example I've seen of doing this.
(Proviso: I'm using Chrome for Windows, not Linux. Apparently, that may make a difference.)
I use Chrome myself, and I always get the pages scrolling in jumps, not smoothly--even the pages you described as 'smooth' above step for me several lines at a time, including the Google results page. There used to be a flag available for this in Chrome, which allowed you to turn on smooth scrolling -- it could be accessed through Chrome's flags (go to chrome://flags/ to see those that are available) -- but it's now only available for the Linux Chrome platform. It may be available again in the future, but for now at least, it isn't. Hopefully, though, these experimental features will eventually find their way into Chrome, and render this whole issue obsolete.
Firefox, on the other hand, scrolls in nice smooth steps no matter what page I'm on--including my own local info pages which have almost no styling at all. IE scrolls smoothly, though not nearly as nicely as Firefox, while Opera behaves like Chrome, and steps through the pages several lines at a time.
I'm pretty sure that this is an issue to do with the browser, and not something that you can currently remedy with styling alone. Sorry I couldn't be of more help, but if you're doing this for a client, at least you'll be able to explain the issue.
I would highly recommend finding an alternate solution, but I have managed to find a solution to this exact problem for one of my websites. Akin to just using glitter glue to solve a leak in a wall, I discovered that including an iframe for a Google map on the page (even if it's hidden) somehow added in smooth scrolling. I have no idea how it works, but for some bizarre reason it does.
As I said though, I highly recommend not doing this, as its an extra (and sometimes lengthy) request made on each page to include an element most users won't ever see.

Additional scrollbar in a menu slow in firefox

So I have this page where I have a big menu that is scrollable with it's own scrollbar. The main scrollbar of the page is hidden which makes it not functional.
On chrome, this menu scrolls silk smooth and everything seems to be fine.
On firefox, the scrolling experience is horrible, it is just not usable. (Smooth scrolling disabled)
Is there something that could be done via css maybe to improve the performance of firefox scrolling?
If I understand your situation correctly, a similar problem regarding Firefox scrolling can be found at: https://support.mozilla.org/en-US/questions/981140
The corresponding solution, given by iamjayakumars states:
"Type about:config in the URL and filter general.smoothScroll.mouseWheel.durationMaxMS change the value as 1000 and try it.
If, it doesn't work try this
Type about:config in the URL and filter mousewheel.enable_pixel_scrolling and change the value as false."