virtual_odin Posted April 4, 2007 Share Posted April 4, 2007 OK, I am creating a control panel pop-up to allow administrators to change certain style settings on a page. The settings themselves are stored in a MySQL table and once the new set-up is acceptable, can be saved back to MySQL so that every future impression of the page is in the new style. So far so good. I have also successfully changed the master document by writing the new style back to the main page using the id/name of a tag, but this requires every instance to have a unique id/name because otherwise if the names are the same, only the first instance of the object is changed. In fact the document has multiple instances of the same style/class. So I want to set up the styles in <head></head> and call them each time they are needed with a class= tag. Bottom line: can Javascript change these style settings in head and have the document change as a result? If so how? My workaround if this is not possible is to save the changes as they are made and re-load the page each time, but I would have to do some fancy footwork to allow regression and it all sounds heavy, when just re-writing the styles would be really neat. As always, I would appreciate suggestions. The test site here is http://example.club-host.com (please excuse the gross colours - they are just there while I sort out table layout, etc). Click on "Admin" to see the control panel. Quote Link to comment Share on other sites More sharing options...
virtual_odin Posted April 5, 2007 Author Share Posted April 5, 2007 The workaround can be seen by clicking "Testing" on the same page - http://example.club-host.com Quote Link to comment Share on other sites More sharing options...
nogray Posted April 5, 2007 Share Posted April 5, 2007 The template you are using looks pretty simple and can be controled using javascript easily without overwriting the style. Since you have a few elements (Header, navigation, side navigation, body, right side, footer) you can make the javascript to change these sections attributes. If you have a lot of links inside (like the navigation), just use the getElementsByTagName and loop through the objects the overwrite their style. You still can overwrite the style tag (I never done that) or access it's childer (classes, definitions, etc) You can view this for more details on the styleSheet http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/objects/obj_stylesheet.asp For colors, you can use the NoGray color picker Good luck Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.