Skip to content
This repository has been archived by the owner on Mar 27, 2019. It is now read-only.

scroller div will not scroll if dynamically populated #1234

Open
john-pallissard opened this issue May 10, 2018 · 1 comment
Open

scroller div will not scroll if dynamically populated #1234

john-pallissard opened this issue May 10, 2018 · 1 comment

Comments

@john-pallissard
Copy link

Trying to set the innerHTML of the scroller div with an AJAX call.. No luck - no scroll..

If I switch developer mode in Chrome to a mobile emulation scrolling starts to work.

If I then switch back to desktop scrolling continues to function.

using a modified version of the "scrollbars" demo

added the following JavaScript:

<script> function fillScroller() { var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { document.getElementById("scroller").innerHTML = this.responseText; } }; xmlhttp.open("GET","big-text-file.txt", true); xmlhttp.send(); } fillScroller(); </script>
@john-pallissard
Copy link
Author

Fixed my own issue!! Call loaded() just after the div has been populated by the XMLHttpRequest instead of during the onload() event

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant