Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
Dynamic Stylesheets with JavaScript
Old 05-06-2004, 03:12 PM Dynamic Stylesheets with JavaScript
JosefMills's Avatar
Average Talker

Posts: 22
Location: Houston
Trades: 0
I want to have put a script on a site I'm working on that will allow users to change the stylesheet that is currently being used.
I assume I'd have to do it with a cookie, so that the stylesheet won't be reverted to the default file whenever a new page is loaded. But I don't know how I would accomplish that. I don't feel like posting the url here, because I don't want a bunch of hits at the moment. If you need to see it though, message me and I'll tell you.
Thanks for any help.
josefMills:.
JosefMills is offline
Reply With Quote
View Public Profile Visit JosefMills's homepage!
 
 
Register now for full access!
Old 05-07-2004, 06:10 AM
Ultra Talker

Posts: 377
Trades: 0
You may place a form to fill (like background color, text-color, text-size etc.). user would fill it, send it to you. then your script would transform this info to css file for example named user1.css . And the on logging in another script would just change a name of used styelsheet. This is just my idea...
__________________
andrews_john

Please login or register to view this content. Registration is FREE
andrews_john is offline
Reply With Quote
View Public Profile Visit andrews_john's homepage!
 
Old 05-07-2004, 06:20 AM
Super Talker

Posts: 112
Trades: 0
I would really love to hear if anyone has any suggestions.

The ability to change a CSS file dynamically, really has a lot of potential.

Anyone know if you can use the <CFOUTPUT> tag is a CSS file?
SEbasic is offline
Reply With Quote
View Public Profile
 
Old 05-07-2004, 02:34 PM It's possible
JosefMills's Avatar
Average Talker

Posts: 22
Location: Houston
Trades: 0
I thought of a way, but I don't know if works in the right places of the code.

The idea I had, was set a cookie when the page loads, unless a cookie already exists. The cookie would set the page to use the default stylesheet. But there would be a pull down index where the user could change what stylsheet is being used. When the sheet is selected from the list, it resets the cookie.

The whole point of the cookie, is to call for the desired stylesheet. The deal is, I don't think it's possible to call a stylesheet anywhere other than the head, and I don't know if you can use cookies in the head. But I'm relatively new to JS, which is why I was asking this question in the first place...

Anyone?
JosefMills is offline
Reply With Quote
View Public Profile Visit JosefMills's homepage!
 
Reply     « Reply to Dynamic Stylesheets with JavaScript
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.68526 seconds with 12 queries