Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Simple Scripts In Html And Javascript, Things like BackgroundColorChanger and so
Rating 5 V
2091
post 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 smile.gif
Go to the top of the page
 
+Quote Post
MetalGear
post 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
Go to the top of the page
 
+Quote Post
Kioku
post 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.
Go to the top of the page
 
+Quote Post
cybermandu
post 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
Go to the top of the page
 
+Quote Post
sportytalk
post 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 smile.gif
Go to the top of the page
 
+Quote Post
zamaliphe
post 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 biggrin.gif
Go to the top of the page
 
+Quote Post
suberatu
post 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.
Go to the top of the page
 
+Quote Post
azri92
post 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...
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. HTML tags and examples(37)
  2. Check Your Scripts(4)
  3. Image Preloader With Progress Bar Status(22)
  4. Css And Javascript Combined For Dynamic Layout(9)
  5. Image Rollovers In Javascript(11)
  6. Cpanel Preinstalled Scripts, Extras, And Cpanel Options(1)
  7. Integrating Html And Css Part 1(5)
  8. Fast Template Design In Joomla Cms(2)
  9. Document Type Declarations(0)
  10. How To Make A Simple File Based Shoutbox Using Php And Html(8)
  11. Do You Want To Use Php Code In Your Html Pages?(9)
  12. Javascript Scroll Bar(13)
  13. Spice Up Your Forms(11)
  14. Mootools - My Favourite Javascript Library(3)
  15. How To Install Php Scripts(0)
  1. Html Legend(9)
  2. Create A Simple Html Editor With Php And Javascript(3)
  3. Creating Navigation For Html Websites(12)
  4. Want-to-start Html Tutorials(2)
  5. Html Bdo...(13)
  6. Html Span(7)
  7. Cakephp On Ubuntu(0)
  8. [php] Clean Code Functions(5)
  9. Simple Javascript And Password System(6)
  10. How To: Html Tables.(8)
  11. Make A Moderately-secure Password System Using Javascript(4)
  12. Lesser Known Useful Javascript Features(2)
  13. Add Flashing Inbox To Invisionfree Forum(0)