|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
CSS - Theme Switch
Hello all once again.
Ok, I have been playing about with css and looking around many different sites till I found an article from 'a list apart': Click here to view So, Here is the page I want two be able to change: click here I have this in the Head : Quote:
and these are the links in the page: Quote:
The .js files contains this: function setActiveStyleSheet(title) { var i, a, main; for(i=0; (a = document.getElementsByTagName("link")[i]); i++) { if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) { a.disabled = true; if(a.getAttribute("title") == title) a.disabled = false; } } } function getActiveStyleSheet() { var i, a; for(i=0; (a = document.getElementsByTagName("link")[i]); i++) { if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title"); } return null; } function getPreferredStyleSheet() { var i, a; for(i=0; (a = document.getElementsByTagName("link")[i]); i++) { if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("rel").indexOf("alt") == -1 && a.getAttribute("title") ) return a.getAttribute("title"); } return null; } function createCookie(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else expires = ""; document.ignore = name+"="+value+expires+"; path=/"; } function readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null; } window.onload = function(e) { var cookie = readCookie("style"); var title = cookie ? cookie : getPreferredStyleSheet(); setActiveStyleSheet(title); } window.onunload = function(e) { var title = getActiveStyleSheet(); createCookie("style", title, 365); } var cookie = readCookie("style"); var title = cookie ? cookie : getPreferredStyleSheet(); setActiveStyleSheet(title);[/QUOTE] So I have it all uploaded but when I try to change to the red theme nothing happens and when I try to open the .js file I get an error. Can someone plz help ![]() Once again: click here to see the page I am working on. Thank you |
|
#2
|
||||
|
||||
|
Hmm, which browser are you using?
Also when I am visiting your site with Firebird, there seems to be a problem with the layers as the links lie over the main banner %) There was a thread like easier yesterday, so if you please search for it. Basicly, go to www.w3.org/Style and then Zengarden and you will find very profound help ![]() Please do some research - if it doesn't work afterwards please post again ![]() |
|
#3
|
|||
|
|||
|
I have done research and have followed the instructions but its still causing an error for me
![]() I'm using IE, must be that firebird doesn't have enough support for css. Anyone able to point out whats causing the problem plz? |
|
#4
|
||||
|
||||
|
mpf Firebird has way more css support then any available Internet Explorer. And if you have done some research why can't point out your error messages?
|
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > CSS - Theme Switch |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|