|
|
|
|
![]() ![]() |
Dec 18 2006, 10:42 AM
Post
#1
|
|
|
Member [Level 3] ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 90 Joined: 8-October 04 From: vienna Member No.: 1,509 |
like in the topic, here is a description how to change the Backgroundcolor "On The Fly", by klicking on a button or radio-box
first, we ned the html-and body-tags, create a new html-file on your desktop and write the following: QUOTE <html> <body> <script language = "JAVASCRIPT"> </script> </body> </html> browser interpretation: html - tag means "hey, browser, here comes HTML" in the body-tag you define the looking of your site. you can add things like "bgcolor" for the background, "text" for the textcolor and link / alink / hlink / vlink to define the linkcolor (<body bgcolor='#000000' text='#FFA500' link='#FFA500' vlink='#FFA500'>) the scripttag is the tag, we'll need now (sorry, but my english isn't very well) modify your file and type in the SCRIPT - TAG: CODE function bgcsel(color){ document.bgColor=color; } this is the function, witch will change the bgcolor. now we'll type the rest, to let the function go: write between the html tags CODE <input type = radio onClick = java script:bgcsel('#FFA500')>switch to Orange <input type = radio onClick = java script:bgcsel('#FF0000')>switch to Red <input type = radio onClick = java script:bgcsel('#000000')>switch to Black now, when you look at the site andd klick on a radiobutton, the bgcolor will change BTW: try to replace the "onClick" by "onMouseover" the final file looks like this: CODE <html> <body> <script language = "JAVASCRIPT"> function bgcsel(color){ document.bgColor=color; } </script> </body> </html> simple color changer |
|
|
|
Dec 22 2006, 05:30 PM
Post
#2
|
|
|
Newbie [Level 1] ![]() Group: Members Posts: 14 Joined: 15-December 06 Member No.: 35,363 |
nise thing thanks for sharing man i learn something new
thanks again |
|
|
|
Dec 23 2006, 05:17 AM
Post
#3
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 293 Joined: 17-December 05 From: Error 404 Member No.: 15,848 |
This could be interesting, but I have some doubts as to its usefulness.
|
|
|
|
Dec 23 2006, 08:20 AM
Post
#4
|
|
|
Newbie ![]() Group: Members Posts: 2 Joined: 18-December 06 Member No.: 35,537 |
nice script i think this would be helpful for the webdesigners
|
|
|
|
Dec 25 2006, 02:02 AM
Post
#5
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 326 Joined: 7-October 05 Member No.: 12,650 |
This is a nice tutorial including some simple html and javascript scripts. As said in one of the above posts, these scripts certainly help the web designers add more dynamic content to their websites.
It is important to note though, that internet browsers allow you to disable javascript code. If your users have javascript disabled, they will not be able to see the dynamic features which you intend for them to be able to view. You need to be aware of this and ensure that there isn't too great a dependency for using Javascript. Nice code though, will certainly help those who are looking for codes similar to the ones you have posted in this tutorial. Thanks for sharing |
|
|
|
Oct 18 2007, 12:30 AM
Post
#6
|
|
|
Advanced Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 131 Joined: 1-February 07 Member No.: 38,108 |
will i thought it will be the dampest tutorials but i was wrong i learned some thing new today
thanks |
|
|
|
Oct 20 2007, 11:36 PM
Post
#7
|
|
|
Advanced Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 132 Joined: 23-September 07 Member No.: 50,511 |
It's pretty easy stuff, but useful for those who don't have any background in webcoding/design and want to be able to know how to do this kind of stuff.
|
|
|
|
Mar 20 2008, 09:31 AM
Post
#8
|
|
|
Newbie [Level 1] ![]() Group: Members Posts: 10 Joined: 9-February 08 Member No.: 57,617 |
thanx for that post...
|
|
|
|
![]() ![]() |
Similar Topics