Welcome visitor
* Login
* Register
It is currently May 20th, 2019, 12:28 pm
All times are UTC [ DST ]
* Search
View unanswered posts - View active topics

FORUMS » Client Side » HTML



Post new topic Reply to topic  [ 2 posts ] 
Author Message
  switch css style sheets
PostPosted: April 11th, 2009, 7:05 pm 
User avatar

Posts: 52
hi, i have two style sheets and a button that i want to use to change from one style sheet to the other, what script or function can do this?

tia


Top
 Profile  
 
  Re: switch css style sheets
PostPosted: April 11th, 2009, 7:12 pm 

Posts: 65
I think this can do what you are asking.
<head>
    <link rel="stylesheet" type="text/css" href="fst.css" id="css1" />
    <link rel="alternate" type="text/css" href="scn.css" id="css2" />   
<script type="text/javascript">
function xchange(){
w=document.getElementById("css1");
x=document.getElementById("css2");
w.rel='alternate';
x.rel='stylesheet';
w.id='css2';
x.id='css1';}
</script>
</head>
<input type="button" value="css style" onClick="xchange();" />


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

FORUMS » Client Side » HTML


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron