Thread: [SOLVED] one css stylesheet
View Single Post
Old 17th July 13, 01:37 PM   #6
ianhaney
WLC Lover
 
Join Date: Jun 2012
Posts: 78
Default Re: one css stylesheet

No worries

Below is the code used that solved my issue

Code:
<link id="size-stylesheet" rel="stylesheet" type="text/css" href="./css/style.css" />
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script>

function adjustStyle(width) {
    width = parseInt(width);
    if (width <= 1024) {
        $("#size-stylesheet").attr("href", "./css/style.css");
    } else if ((width > 1100)) {
        $("#size-stylesheet").attr("href", "./css/wide.css");
    /*} else {
      $("#size-stylesheet").attr("href", "./css/style.css");*/
                }
}

$("document").ready(function(){
    adjustStyle($(window).width());
    $(window).resize(function() {
        adjustStyle($(window).width());
    });
});

</script>
ianhaney is offline   Reply With Quote