IPad Scroll Issues with Fixed Content - Rick Strahl's Web Log

 

mobile fixed position scroll

I know iPhones used to not support position:fixed, but now it does and I'm seeing a weird glitch when I scroll a fixed position element behind other elements with higher z-index. The fixed positions element with the lower z-index appears in front momentarily, which looks really bad. Is . /* The sticky class is added to the header with JS when it reaches its scroll position */.sticky { position: fixed; top: 0; width: %} /* Add some top padding to the page content to prevent sudden quick movement (as the header gets a new position at the top of the page (position:fixed . I have a div positioned fixed on the left side of a web page, containing menu and navigation links. It has no height set from css, the content determines the height, the width is fixed. The problem is that if the content is too much, the div will be larger than the window's height, and part of the content will not be visible. (Scrolling the window doesn't help, since the position is fixed and.


ios - Mobile safari position:fixed z-index glitch when scrolling - Stack Overflow


By using our site, you acknowledge that you have read and understand our Cookie PolicyPrivacy Policyand our Terms of Service. Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. I have a div positioned fixed on the left side of a web page, containing menu and navigation links. It has no height set from css, the content determines the height, the width is fixed. The problem is that if the content is too much, the div will be larger than the window's height, and part of the content will not be visible.

Scrolling the window doesn't help, since the position is fixed and the div won't scroll. I tried to set overflow-y:auto; but that doesn't help either, the div doesn't seem to notice that part of it is outside of the window. How can I make it's contents scrollable only, if needed, if the div hangs out of the window? You probably can't. Here's something that comes close. You won't get content to flow around it if there's space below. The link below will demonstrate how I accomplished this.

Not very hard - just have to use some mobile fixed position scroll front-end dev!! This is absolutely doable with some flexbox mobile fixed position scroll. Have a look at this pen.

Link to jsFiddle:. I'm presenting this as a workaround rather than a solution. This may not work all the time. I did it this way as I'm doing a very basic HTML page, for internal use, in a very bizarre environment. I know there are libraries like MaterializeCSS that can do really nice nav bars. I was going to use them, but it didn't work with my environment.

Learn more. First 10 Free. How can I make the contents of a fixed element scrollable only when it exceeds the height of the viewport? Ask Question. Asked 5 years, 11 months ago. Active 14 days ago. Mobile fixed position scroll k times. Mkoch Mkoch 1 1 gold badge 7 7 silver badges 19 19 bronze badges. A solution with CSS calc can be found here : stackoverflow.

If you choose to use it, make sure you know your target audience and test it in those browsers. Ryan Brackett Ryan Brackett 7 7 silver badges 11 11 bronze badges.

You probably need an inner div. With css is:. Try this on your position:fixed element. Lucas Bustamante Lucas Bustamante 5, 2 2 gold badges 45 45 silver badges 60 60 bronze badges. Here is the code:. Manoj Negi Manoj Negi 9 9 silver badges 10 10 bronze badges. Tyler Montney Tyler Montney 9 3 3 bronze badges. Add this to your code for fixed height and add one scroll. Saurav Sen Saurav Sen 9 2 2 bronze badges.

Sign up or log in Sign up using Google. Sign up using Facebook, mobile fixed position scroll. Sign up using Email and Password. Post as a guest Name, mobile fixed position scroll. Email Required, but never shown. Featured on Meta. Linked 2, mobile fixed position scroll. Related Hot Network Questions. Question feed. Stack Overflow works best with JavaScript enabled.

 

Fixed Positioning in Mobile Browsers

 

mobile fixed position scroll

 

position: fixed doesn't work on iPad and iPhone. Ask Question .fixed-position-on-mobile { position: fixed; transform: translate3d(0,0,0); } In my case, scrolling showed the position: fixed element that didn't originally show when added to the DOM. So I just manually triggered the scroll event which in turn triggered a redraw and voila. Step 2) Add CSS: To create a fixed top menu, use position:fixed and topNote that the fixed menu will overlay your other content. To fix this, add a margin-top (to the content) that is equal or larger than the height of your menu. Nov 10,  · Fixed positioned elements (typically headers or footers) are extremely common conventions for native mobile platforms, so naturally fixed elements found their way into mobile browsers. Web designers are used to fixing elements to the window using CSS’s position: fixed, however, in the land of.