This fixed position div can be achieved in just 2 lines of code which moves the div on scroll to the bottom of the page.
window.onscroll = function() {
document.getElementById('fixedDiv').style.top =
(window.pageYOffset + window.innerHeight - 25) + 'px';
};
More Related Contents:
- Javascript for “Add to Home Screen” on iPhone?
- iOS 8 removed “minimal-ui” viewport property, are there other “soft fullscreen” solutions?
- iScroll 4 not working with form element iPhone Safari and Android browser
- Is there any way to use window.onbeforeunload on Mobile Safari for iOS devices?
- programmatically changing webkit-transformation values in animation rules
- How to detect in iOS webapp when switching back to Safari from background?
- Preventing default context menu on longpress / longclick in mobile Safari (iPad / iPhone)
- Strange behavior of select/dropdown’s onchange() JS event when using ‘Next’ on Mobile Safari Dropdown list item select box
- Determine if user navigated from mobile Safari
- iphone/ipad triggering unexpected resize events
- Available iPhone Web Application JavaScript UI Library/Frameworks
- Mobile Safari on iOS crashes on big pages
- Javascript date parsing on Iphone
- How do I hide the address bar on iPhone?
- How do I put a clear button inside my HTML text input box like the iPhone does?
- How to implement an onmousedown and onmouseup on an iPhone touch screen
- How to read with JavaScript [closed]
- How to implement something like this GIF that using mouse drag and select items
- Javascript counting all the characters from a HTML document
- Disabling browser print options (headers, footers, margins) from page?
- How to get the actual rendered font when it’s not defined in CSS?
- How to create a sticky navigation bar that becomes fixed to the top after scrolling
- Access CSS variable from javascript [duplicate]
- How to make jQuery to not round value returned by .width()?
- Font size rendering inconsistencies on an iPhone
- Dark mode flickers a white background for a millisecond on reload
- Preventing Child from firing parent’s click event
- Gaussian Blur onHover Using jQuery
- How to keep elements non-refreshed
- How to get a leaflet map canvas to have a 100% height?