CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 29th, 2003, 08:01 AM
TRshady TRshady is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 245 TRshady User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 Days 1 h 48 m 2 sec
Reputation Power: 5
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:
<LINK rel="stylesheet" href="green.css" type="text/css">
<link rel="alternate stylesheet" type="text/css" href="red.css" title="red" />
<script type="text/javascript" src="/scripts/styleswitcher.js"></script>


and these are the links in the page:
Quote:
<a href="#" onclick="setActiveStyleSheet('green'); return false;">change style to default</a><br />
<a href="#" onclick="setActiveStyleSheet('red'); return false;">change style to red</a>


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

Reply With Quote
  #2  
Old August 29th, 2003, 08:58 AM
fgeller's Avatar
fgeller fgeller is offline
:(){ :|:&};:
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Germany
Posts: 297 fgeller User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 4 m 52 sec
Reputation Power: 5
Send a message via ICQ to fgeller
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
__________________
regards >_<

ws. fgeller.de
em. felix@fgeller.de

Reply With Quote
  #3  
Old August 29th, 2003, 09:04 AM
TRshady TRshady is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 245 TRshady User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 Days 1 h 48 m 2 sec
Reputation Power: 5
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?

Reply With Quote
  #4  
Old August 29th, 2003, 09:09 AM
fgeller's Avatar
fgeller fgeller is offline
:(){ :|:&};:
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Germany
Posts: 297 fgeller User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 4 m 52 sec
Reputation Power: 5
Send a message via ICQ to fgeller
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?

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > CSS - Theme Switch


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway