Previously, the code was clearing all content from the div it was assigned when the page was re-sized. A unique class is now added to all elements created by the script and then only those elements are removed when the view switches between mobile and desktop.