Hello,
I'm trying to write a bit in Javascript for a mobile website. I've searched all over Google and found some help, but I'm having some kind of problem implementing it.
In the HTML Header (note, no CSS file specified here):
<script type="text/javascript" src="scrnsz.js"></script>
JavaScript:
if (screen.width > 200) {
link = document.getElementsByTagName("link")[0];
link.href = "style.css";
}
if (screen.width <= 200) {
link = document.getElementsByTagName("link")[0];
link.href = "smstyle.css";
}
Can any pros help? :) Thank you.