I have an autocomplete. When the dropdown appears, it may go out of view because it is close to the bottom.
The height of the div that contains this dropdown is increases. However, it does not automatically scroll to the end.
How to get it to scroll to the end?
Related
I have a vertical list which fixed in user viewport when user scroll it, in some background is not good color, so I want to hide it when reach to that area. and when scroll to up get back.
I want to hide specific div or list when user reach to that div.
I have a situation where when child scroll reaches bottom parent scroll takes over and starts scrolling the whole screen.
Basicall I have normal icon page with a horizontal bar at top. When user clicks on top bar a div slid downs showing the list of items covering whole screen except top bar. Because this list is loner than the screen height I have allowed vertical scrolling in div. Now the problem is when the user is scrolling inside div and reaches the bottom of the list, the background page starts scrolling up.
What I want is, inside the div scrolling should not scroll the background/parent page when user reaches bottom of the list.
code sample (in browser you will need to move mouse a bit after reaching bottom)
https://stackblitz.com/edit/ionic-forum-5-jhl2pw
Thanks
I have a div filled with enough elements that makes the scroll bar appear.
I scroll down half way and then refresh the page.
The div is now empty so it has no scroll bar since its set to
overflow:auto
Then I set the div to reset its scroll position with
$(".myclass")[0].scrollTop = 0;
Then I add the elements to the div again and it scrolls back to the halfway mark that it was at before the refresh emptied it.
It seems that the div ignores the command to set the scroll if the scrollbar is not visible and active.
How can I set the position of the scrollbar back to the top while it is empty?
edit: I made a really hacky solution by adding a massive div to make the scrollbar appear and then I remove it after I set the scrollTop to zero, but there should be a better solution than that.
So I need an offsetBottom() jQuery function essentially. I have a fixed div that overlays the entire website, but I also have a div at the bottom of each page which contains the exact same content. My goal is to get the fixed overlay to disappear once the TOP of the div at the bottom of the page becomes visible, or is at the same height from the bottom as the overlay, even when the page is resized, then the overlay re-appears when the top of the div goes below the fixed div.
I am sorry I have no code example, I have been trying to use offsetTop() but the pages are of varying heights and it will only show/hide when the div reaches the very top of the web browser.
I have a fixed header which has a button (menu icon) on it. Whenever I scroll down the header will show (as it’s fixed). When I click on the menu button the menu is then also in a fixed position on the right hand side. When I scroll down both header and menu show which is fine. THE PROBLEM is when I initially scroll down half way down the page AND THEN click on the menu button the menu (div) is at the top-when I scroll a bit then it displays. There's a delay in this. Do you know how I can get the menu to display regardless of where I am on the page (in terms of y position)????
Top is set as 100px for the menu in a class (as the headers height is 100px-so i want the menu to show under it) BUT obviously if I’m already half way down the page the menu still takes into account the top: 100px however, I want it to change because I’ve scrolled down so the top position value would be different.
Any help??
Taking a shot in the dark, I think your problem is where your fixed position checks are taking place - I.E, I'm guessing they're within the .scroll event of the window.
Before you scroll down, and you click on the menu button, it is set to display block in its initial position - which is correct, because you haven't scrolled down yet.
However, if you scroll down first, then display the menu - it's still going to display in it's initial position - because the check is in your .scroll event - which you haven't fired while the menu has been open.
Try applying the position check in the button logic too.