In short, what I did here is used the navigator.userAgent request header to detect what OS the user is running. This method is widely supported by browsers and not to hard to implement.
Once I know which OS, I show and hide divs in the project accordingly.
Here is the code:
<script>
if ( /iPhone|iPad|iPod/i.test(navigator.userAgent) ) {
$("#android").hide();
$("#web").hide();
}
else if ( /Android|webOS|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
$("#ios").hide();
$("#web").hide();
}
else {
$("#ios").hide();
$("#android").hide();
}
</script>
When your bath soap bar gets too small to use, don't throw it away! open the next bar, and when you finish showering, stick the small old bar to the back of the new bar. Onces they both dry, they will become one.