The Cave of Dragonflies forums

Go Back   The Cave of Dragonflies forums > Websites > Webmaster Help and Discussion


Thread Tools
Old 03-17-2013, 05:32 AM
mewtini's Avatar
mewtini mewtini is offline
bubblegum bitch
Join Date: February 27, 2011
Location: astral plane
Age: 18
Posts: 1,459
Pronoun: she/her/hers
mewtini is an unknown quantity at this point
Posticon Scared Eep, stylesheet switcher.


I'm no whiz at HTML/CSS, but I have some knowledge at it; probably best to get that out there.

So I have three stylesheets, the default is titled "title="stylesheet", the other two are "title="alternate stylesheet", so I can switch between them via browser, but I'd like to somehow grab cookies and get it together dynamically. I have absolutely no idea how to do that, and I have no knowledge in any other languages (I dabbled in Java and JavaScript, but not very far beyond "Hello World!"). So, I don't know, but. Help?
"don't pretend you ever forgot about me."
Reply With Quote
Old 07-17-2013, 02:07 AM
42aruaour's Avatar
42aruaour 42aruaour is offline
Time: I come from the past. O.o
Join Date: July 17, 2013
Location: This Universe, Planet Earth
Posts: 118
Pronoun: he
42aruaour is an unknown quantity at this point
Default Re: Eep, stylesheet switcher.

I am not quite sure what you wish to do, but I'm guessing that you want to be able to automate the changing of a stylesheet when there is a different local variable? Would it be something like the front page style switcher on TCoD?

In that case, then you could use many different languages to get it done. I would suggest Javascript, unless you needed to run this with a database, in that case then Javascript and PHP.

I think you probably want to use Javascript. There should either be two scripts, or a script with two functions. One of which, upon page load, checks for the cookie, and makes the appropriate stylesheet selection. The other would be used in an html form and creates the cookie to last a time span (probably around thirty days?). The value in the cookie would probably be either default, style1, or style2.

Running a quick google search brings this page, It should help in this case:

And if you have any problems, you can go to Stack Overflow and check for answers to that specific problem.

Sorry I couldn't help much. I have only done basic scripting with javascript and am not familiar with it, because I use PHP more often.
Reply With Quote

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 08:49 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Pokémon, Pikachu and all other Pokémon characters © Nintendo, Game Freak and Creatures Inc. The Cave of Dragonflies, content, styles, etc. © Butterfree/Dragonfree/antialiasis.
Forum now hosted by Eevee's HQ.