How to make css picked using javascript on a page the css style for all pages

Tags: javascript
Question!

I am using Javascript to change the css of my web page and I am trying to figure out how to make which ever css is picked, the css for all other pages on my site.

Here is my code:

<link id="pagestyle" rel="stylesheet" type="text/css" href="dash4.css">
<script>
function swapStyleSheet(sheet){
    document.getElementById('pagestyle').setAttribute('href', sheet);
}
</script>
 <button class="settings" onclick="swapStyleSheet('dash4.css')">    COMFORTABLE</button>
        <button class="settings" onclick="swapStyleSheet('dash4_minimal.css')">MINIMAL</button>


Answers

just put your script before the closing tag of your body and with jquery write

$(document).ready(function(){
    $("#button-id").click(function(){
        $("#pagestyle").attr("href",sheet);
    });
});


The type of e1 is Event the type of e2 is *Event. The initialization is actually the same (using composite literal syntax, also not sure if that jargon is Go or C# or both?) but with e2 you using the 'address of operator' & so it returns a pointer to that object rather than the instance itself.



Subtract the julian day integer of the earlier date from the julian integer of the later date. The following tells you exactly how to do that.

http://www.cs.utsa.edu/~cs1063/projects/Spring2011/Project1/jdn-explanation.html

Otherwise, http://pdc.ro.nu/jd-code.html already has a C version

long gregorian_calendar_to_jd(int y, int m, int d)
{
    y+=8000;
    if(m<3) { y--; m+=12; }
    return (y*365) +(y/4) -(y/100) +(y/400) -1200820
          +(m*153+3)/5-92
          +d-1;
}


This video can help you solving your question :)
By: admin