473,395 Members | 1,456 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

how to use different css file link in one page(for changing the color of the page)

30
hello

I have a problem that how to use different css files in one single page.
In that page how to pass link using dropdown menu and select link for css file and it will change the color of whole page.
(I have seen yahoo.com examlpe )i am trying to do the same work in my website.main Page.


Plz..........................
Reply me as soon as possible.

Thanks
Apr 11 '07 #1
3 1729
drhowarddrfine
7,435 Expert 4TB
I have not done this for anything myself but, off the top of my head, I can only think of two ways. One is using javascript and the other is to let your drop down send a form to your server which reserves the page with the correct CSS file.
Apr 11 '07 #2
i cann't help you but i am in same problem so please member of the scripts please give the solutions not description
Apr 11 '07 #3
hi all
here a javascript i wrote
to change the text or background color of your page,
a combobox for the colors ,and 2 checkboxes for text or background selection
,and a button to change the color.
140 colors
check it

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <title>Choose a Color from the combobox to change the text color or the background color</title>
  4. <script type="text/javascript">
  5.  
  6. // Author : fjhdehoog 
  7. // How 2 use : 3 Steps
  8. // Step 1 : Copy all script including tags to your head section as in this example
  9. // Step 2 : place the span where u want the combo box to be in your body. ;P 
  10. // Step 3 : To remove colors just comment out the number of items u wanna remove from bottom to up :)
  11. //,To add colors just extend the array 
  12.  
  13.  
  14. // Author : fjhdehoog 
  15. ThaColors = new Array();
  16. ThaColors[0]='AliceBlue';
  17. ThaColors[1]='AntiqueWhite';
  18. ThaColors[2]='Aqua';
  19. ThaColors[3]='Aquamarine';
  20. ThaColors[4]='Azure';
  21. ThaColors[5]='Beige';
  22. ThaColors[6]='Bisque';
  23. ThaColors[7]='Black';
  24. ThaColors[8]='BlanchedAlmond';
  25. ThaColors[9]='Blue';
  26. ThaColors[10]='BlueViolet';
  27. ThaColors[11]='Brown';
  28. ThaColors[12]='BurlyWood';
  29. ThaColors[13]='CadetBlue';
  30. ThaColors[14]='Chartreuse';
  31. ThaColors[15]='Chocolate';
  32. ThaColors[16]='Coral';
  33. ThaColors[17]='CornflowerBlue';
  34. ThaColors[18]='Cornsilk';
  35. ThaColors[19]='Crimson';
  36. ThaColors[20]='Cyan';
  37. ThaColors[21]='DarkBlue';
  38. ThaColors[22]='DarkCyan';
  39. ThaColors[23]='DarkGoldenRod';
  40. ThaColors[24]='DarkGray';
  41. ThaColors[25]='DarkGreen';
  42. ThaColors[26]='DarkKhaki';
  43. ThaColors[27]='DarkMagenta';
  44. ThaColors[28]='DarkOliveGreen';
  45. ThaColors[29]='Darkorange';
  46. ThaColors[30]='DarkOrchid';
  47. ThaColors[31]='DarkRed';
  48. ThaColors[32]='DarkSalmon';
  49. ThaColors[33]='DarkSeaGreen';
  50. ThaColors[34]='DarkSlateBlue';
  51. ThaColors[35]='DarkSlateGray';
  52. ThaColors[36]='DarkTurquoise';
  53. ThaColors[37]='DarkViolet';
  54. ThaColors[38]='DeepPink';
  55. ThaColors[39]='DeepSkyBlue';
  56. ThaColors[40]='DimGray';
  57. ThaColors[41]='DodgerBlue';
  58. ThaColors[42]='FireBrick';
  59. ThaColors[43]='FloralWhite';
  60. ThaColors[44]='ForestGreen';
  61. ThaColors[45]='Fuchsia';
  62. ThaColors[46]='Gainsboro';
  63. ThaColors[47]='GhostWhite';
  64. ThaColors[48]='Gold';
  65. ThaColors[49]='GoldenRod';
  66. ThaColors[50]='Gray';
  67. ThaColors[51]='Green';
  68. ThaColors[52]='GreenYellow';
  69. ThaColors[53]='HoneyDew';
  70. ThaColors[54]='HotPink';
  71. ThaColors[55]='IndianRed';
  72. ThaColors[56]='Indigo';
  73. ThaColors[57]='Ivory';
  74. ThaColors[58]='Khaki';
  75. ThaColors[59]='Lavender';
  76. ThaColors[60]='LavenderBlush';
  77. ThaColors[61]='LawnGreen';
  78. ThaColors[62]='LemonChiffon';
  79. ThaColors[63]='LightBlue';
  80. ThaColors[64]='LightCoral';
  81. ThaColors[65]='LightCyan';
  82. ThaColors[66]='LightGoldenRodYellow';
  83. ThaColors[67]='LightGrey';
  84. ThaColors[68]='LightGreen';
  85. ThaColors[69]='LightPink';
  86. ThaColors[70]='LightSalmon';
  87. ThaColors[71]='LightSeaGreen';
  88. ThaColors[72]='LightSkyBlue';
  89. ThaColors[73]='LightSlateGray';
  90. ThaColors[74]='LightSteelBlue';
  91. ThaColors[75]='LightYellow';
  92. ThaColors[76]='Lime';
  93. ThaColors[77]='LimeGreen';
  94. ThaColors[78]='Linen';
  95. ThaColors[79]='Magenta';
  96. ThaColors[80]='Maroon';
  97. ThaColors[81]='MediumAquaMarine';
  98. ThaColors[82]='MediumBlue';
  99. ThaColors[83]='MediumOrchid';
  100. ThaColors[84]='MediumPurple';
  101. ThaColors[85]='MediumSeaGreen';
  102. ThaColors[86]='MediumSlateBlue';
  103. ThaColors[87]='MediumSpringGreen';
  104. ThaColors[88]='MediumTurquoise';
  105. ThaColors[89]='MediumVioletRed';
  106. ThaColors[90]='MidnightBlue';
  107. ThaColors[91]='MintCream';
  108. ThaColors[92]='MistyRose';
  109. ThaColors[93]='Moccasin';
  110. ThaColors[94]='NavajoWhite';
  111. ThaColors[95]='Navy';
  112. ThaColors[96]='OldLace';
  113. ThaColors[97]='Olive';
  114. ThaColors[98]='OliveDrab';
  115. ThaColors[99]='Orange';
  116. ThaColors[100]='OrangeRed';
  117. ThaColors[101]='Orchid';
  118. ThaColors[102]='PaleGoldenRod';
  119. ThaColors[103]='PaleGreen';
  120. ThaColors[104]='PaleTurquoise';
  121. ThaColors[105]='PaleVioletRed';
  122. ThaColors[106]='PapayaWhip';
  123. ThaColors[107]='PeachPuff';
  124. ThaColors[108]='Peru';
  125. ThaColors[109]='Pink';
  126. ThaColors[110]='Plum';
  127. ThaColors[111]='PowderBlue';
  128. ThaColors[112]='Purple';
  129. ThaColors[113]='Red';
  130. ThaColors[114]='RosyBrown';
  131. ThaColors[115]='RoyalBlue';
  132. ThaColors[116]='SaddleBrown';
  133. ThaColors[117]='Salmon';
  134. ThaColors[118]='SandyBrown';
  135. ThaColors[119]='SeaGreen';
  136. ThaColors[120]='SeaShell';
  137. ThaColors[121]='Sienna';
  138. ThaColors[122]='Silver';
  139. ThaColors[123]='SkyBlue';
  140. ThaColors[124]='SlateBlue';
  141. ThaColors[125]='SlateGray';
  142. ThaColors[126]='Snow';
  143. ThaColors[127]='SpringGreen';
  144. ThaColors[128]='SteelBlue';
  145. ThaColors[129]='Tan';
  146. ThaColors[130]='Teal';
  147. ThaColors[131]='Thistle';
  148. ThaColors[132]='Tomato';
  149. ThaColors[133]='Turquoise';
  150. ThaColors[134]='Violet';
  151. ThaColors[135]='Wheat';
  152. ThaColors[136]='White';
  153. ThaColors[137]='WhiteSmoke';
  154. ThaColors[138]='Yellow';
  155. ThaColors[139]='YellowGreen';
  156. //------ NO NEED TO ALTER BELOW   -------------------
  157. NrOfColorsInArray=ThaColors.length;
  158. document.write('<span id="dummy" style="visibility:hidden;"></span>'); 
  159. setTimeout('showchangecolorspan()',500);
  160. function showchangecolorspan(){    
  161. TheSpan=document.getElementById('ColorSelectionSpan');
  162. if (TheSpan==null){setTimeout('showchangecolorspan()',1000);}
  163. else{    
  164. document.getElementById('dummy').innerText='<form name="settcolor" action=""><select id="Fgcolors">'; 
  165. for (Y=0; Y < NrOfColorsInArray; ++Y){
  166. document.getElementById('dummy').innerText+='<option style="background-color:'+ ThaColors[Y]+';color:'+ ThaColors[Y]+';" value="' + ThaColors[Y] + '">' + ThaColors[Y]; 
  167. document.getElementById('dummy').innerText+='</select><br><br><input type="checkbox" id="changetext" onclick="Getstatetxt()" value="fg" checked>Change Text color<br><input type="checkbox" id="changebg" onclick="Getstatebg()" value="bg" unchecked>Change background color<br><input type="button" onclick="changecolor()" value="change the color"></form>';
  168. TheSpan.innerHTML=document.getElementById('dummy').innerText;
  169. document.getElementById('dummy').innerText='';;
  170. }
  171. }//
  172. function changecolor(){ 
  173. XColor=document.forms['settcolor'].Fgcolors.value;
  174. for (X=0; X < NrOfColorsInArray; ++X){
  175. if(XColor==ThaColors[X]){NColor=ThaColors[X];X=NrOfColorsInArray;}else {} 
  176. if (document.forms['settcolor'].changetext.checked){document.fgColor=NColor;}
  177. else if (document.forms['settcolor'].changebg.checked){document.bgColor=NColor;}
  178. }//     
  179.  
  180.  function Getstatetxt(){
  181.  if (document.forms['settcolor'].changetext.checked==true){
  182. document.forms['settcolor'].changebg.checked=false;
  183. }else{}    
  184.  }
  185.    function Getstatebg(){
  186.  if (document.forms['settcolor'].changebg.checked==true){
  187. document.forms['settcolor'].changetext.checked=false;
  188. }else{}
  189.  
  190. }     
  191. </script>
  192. </head>
  193. <body > 
  194. Choose a Color to change the text color or the background color
  195. <span id="ColorSelectionSpan"></span>    
  196. </body>
  197. </html>
  198.  
let me know what u think about it
peace
Apr 17 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

14
by: edykstra | last post by:
Hello, If you point your browser to this page, http://prdownloads.sourceforge.net/vnc-tight/tightvnc-1.2.9_x86_viewer.zip?use_mirror=umn the server sends you the HTML page, and very soon...
3
by: Rhino | last post by:
Yesterday, I reworked the index on my site - http://sfl.london.on.ca - so that they used list markup and I'm quite pleased with them. However, I'm having a problem with one small aspect of the menu...
5
by: Juan T. Llibre | last post by:
OK, guys, usually I answer questions instead of asking them, but this thing has me scratching my head. Why is the default for AutoEventWireup different for C# and VB.NET ? In VS 2005, if I...
11
by: bb nicole | last post by:
Below is css for the link color for my homepage... My homepage have 5 different table which contain a link... If i wish to have different color for the link in different table in same page, what...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.