I have to create a website for disable users, where I can change the page contrast css one user selects different colour, so far I have the javascript to do so, but when I click on another page, as in the page reloads/refresh the CSS style goes back to the default one. I understand there must be a way to save it as a cookie, But I am very new to PHP and JavaScript:
Here is my HTML:
<body runat="server" id="Body" style="zoom: 100%">
<div id="container">
<div id="highvis">
<ul>
<li class="highviss"> <a href="#" onclick="swapStyleSheet('css/webcss2.css');return false;">high vis</a>
<li> <a href="#" onclick="swapStyleSheet('css/webcss3.css');return false;">Dark</a>
<li> <a href="#" onclick="swapStyleSheet('css/webcss.css');return false;">Default</a>
<li><a href="#" onclick="zoomIn();return false;">Zoom In ++</a></li>
<li><a href="#" onclick="zoomOut();return false;">Zoom Out -</a></li>
</ul>
</div>
Here is my Javascript:
function swapStyleSheet(sheet) {
document.getElementById('pagestyle').setAttribute('href', sheet);
}
function zoomIn()
{
var Page = document.getElementById('Body');
var zoom = parseInt(Page.style.zoom) + 10 +'%'
Page.style.zoom = zoom;
return false;
}
function zoomOut()
{
var Page = document.getElementById('Body');
var zoom = parseInt(Page.style.zoom) - 10 +'%'
Page.style.zoom = zoom;
return false;
}
Can anyone please help me do this, if not any Ideas, or how can I go by it.