I'm assuming you mean that the windows.png and mac.png images disappear suddenly. This is because you are overwriting everything that is in the <div>
with the id "download_button" using the following line (or the mac equivalent):
$("#download_button").html("Download Company5 for Windows");
Note that the html() method replaces all the html content of the element with the given content. In other words, this will also remove both of the images inside the #download_button
, because they are part of it's html content.
Easiest way to avoid this, is, for example, to put the text itself you want to replace into a separate <span>
with it's own ID and only overwrite the html() of that. That way you wont be removing the <div>
tags within the parent element.