Free Web Hosting Forum
(#1 (permalink))
Old
Junior Member
DannyP is on a distinguished road
 
Posts: 15
Join Date: Oct 2011
Exclamation Java Help Needed - 10-21-2011, 06:43 PM

I am trying to get my site to be able to change font colour and background colour but it doesn't seem to work... I am wondering if this is possible when I already have a javascript to change font size in place and working already on the pages... Please advise.
Reply With Quote
Sponsored Links
(#2 (permalink))
Old
lobrc's Avatar
Administrator
lobrc is on a distinguished road
 
Posts: 5,037
Join Date: Jan 2010
Location: http://www.lobrc.net
Default 10-22-2011, 08:50 AM

That can be done with CSS. The rest of your code would help though


FREE SCRIPT INSTALLATION SERVICE | PREMIUM HOSTING* | LOBRC.NET

*All packages include Quality Support, Website Builder, Free Site Migration, 30 Day Money Back Guarantee, Official cPanel and Fantastico Autoinstaller.

Plus get 20% off with promo code 000WH20. Contact sales for more information.
Reply With Quote
(#3 (permalink))
Old
Junior Member
DannyP is on a distinguished road
 
Posts: 15
Join Date: Oct 2011
Talking Sorted :D - 10-22-2011, 10:15 AM

See this for the code that I have managed to find.
<form>
<font size=5>Colour Scheme</font>
<input type="button"
STYLE="font-size:14; background-color:ffcc00; color:000000"
value="Black on Yellow"
onClick="document.bgColor = '#FFCC00';document.fgColor='#000000';">
<input type="button"
STYLE="font-size:14; background-color:000000; color:FFCC00"
value="Yellow on Black"
onClick="document.bgColor = '#000000';document.fgColor='#FFCC00';">
<input type="button"
STYLE="font-size:14; background-color:00FF00; color:000000"
value="Black on Green"
onClick="document.bgColor = '#00FF00';document.fgColor='#000000';">
<input type="button"
STYLE="font-size:14; background-color:000000; color:00FF00"
value="Green on Black"
onClick="document.bgColor = '#000000';document.fgColor='#00FF00';">
<input type="button"
STYLE="font-size:14; background-color:FFFFFF; color:000000"
value="Black on White"
onClick="document.bgColor = '#FFFFFF';document.fgColor='#000000';">
<input type="button"
STYLE="font-size:14; background-color:000000; color:FFFFFF"
value="White on black"
onClick="document.bgColor = '#000000';document.fgColor='#FFFFFF';">

</form>

As you can see, more can be added with nothing more than the html colour codes for the combinations that are being requested. Works perfectly. Just waiting for the opinion of the members of the club I am building the site for
Reply With Quote
(#4 (permalink))
Old
Junior Member
DannyP is on a distinguished road
 
Posts: 15
Join Date: Oct 2011
Talking Link to active page with scripts I found... - 10-22-2011, 10:18 AM

... AND made adjustments to:
See link http://www.bon-amie.comeze.com/index2.html for confirmation of both of my scripts working correctly.
Reply With Quote
(#5 (permalink))
Old
ShocK's Avatar
Senior Member
ShocK is on a distinguished road
 
Posts: 4,099
Join Date: Jul 2011
Location: UK
Default 10-22-2011, 10:23 AM

Excellent Works a treat.
Reply With Quote
(#6 (permalink))
Old
Junior Member
DannyP is on a distinguished road
 
Posts: 15
Join Date: Oct 2011
Default 10-22-2011, 11:22 AM

Glad to share as I am sure I will be asking for more help on here sooner or later. lol
Reply With Quote
(#7 (permalink))
Old
Junior Member
DannyP is on a distinguished road
 
Posts: 15
Join Date: Oct 2011
Exclamation 11-10-2011, 06:17 PM

lobrc, you asked for the rest of my coding when you mentioned that I could use CSS for what I want to do... I want to upgrade to switchable CSS stylesheets... I have the 6 stylesheets ready and the seperate CSS file for the border and fill colours of the navbar and the text size/colour change buttons...Can you help me get the scripting right to get a live stylesheet switcher working please? To be honest, I had forgotten I had this post running as not had reply in a while... lol
Reply With Quote
(#8 (permalink))
Old
Junior Member
DannyP is on a distinguished road
 
Posts: 15
Join Date: Oct 2011
Default 11-10-2011, 06:18 PM

Which code did you actually want?
Reply With Quote
Reply

Tags
java, javascript, script

Thread Tools
Display Modes

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




Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.5.2
vBulletin Skin developed by: vBStyles.com