PDA

View Full Version : Style Switcher - Multiple Styles?



Swaydo
08-11-2008, 02:31 AM
Style Switcher v1.1

Can Be Found Here (http://www.dynamicdrive.com/dynamicindex9/stylesheetswitcher.htm)

Well i'm having a problem, basically on my layout i want TWO stylesheets to apply to the pages look at any one time.

One contaning just the color of the background

Another with everything to create the layout

So the user can change the background color, and also change the layout color by changing one of the two Stylesheets.

Now i wondered if it was a simple case of adding id='' to the style sheet code in <head> and the style changing link, but i'm not that experienced in JS and HTML, or whatever coding language

Help much appreciated, Alex.

Swaydo
08-13-2008, 03:40 PM
anybody know how, i really need

rangana
08-14-2008, 12:39 AM
Yes, it was clear, but confusing, your goal is to give an id to the <style> tag? If so, try to have this script:


<script type="text/javascript">
window.onload=function(){
document.getElementsByTagName('style')[0].setAttribute('id','whatever');
// Set the ID of the first <style> tag.
}
</script>


If nothing works, mind rephrasing your question.

Swaydo
08-15-2008, 12:46 AM
Ok Sorry about the question.

I have two CSSs

One for theme color, one for box colour (dosent matter really)

Now i have two so say i can have blue theme, orange boxes.

Now i want to be able to switch these two styles.

like using a link i want to change theme to green.

and with another change boxes to red

so basically i need a way of using the style switcher script v1.1 to be able to work on two styles induvidually

hope that clears up things, im sorry about not being clear.

Swaydo
08-15-2008, 09:15 AM
Please guys
there must be a way!

Swaydo
08-17-2008, 06:09 PM
Please?