FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

A little change color script required

 


imagefree
Hi friends!!
i have designed some pages that i uploaded at rapidshare
Download it here and see.
http://rapidshare.com/files/37851935/bar.rar.html

(Please use Firefox or Opera to view the files so that there is no problem in viewing PNG files)

now the problem is that i have used little color buttons on the top left corner of the pages, click on a color button and the respective page opens having the same color in the background. Actually i have made different pages of different colors.
I have also used Transparent PNG (not gif) to have an effect of background on the image (nevigation bar).

Can you please provide me the java code to change the bg color so that it doesnt require more than 1 pages?


Thanks ---- i am available if you require more details.
and if you give answer, please keep visiting this thread because i want to ask more questions.
wylieconlon
It's very simple code, really, all you need to do is change the document.bgcolor property. This page may have a better explanation than I can give right now.

Ah, actually, that doesn't tell you how to apply the code. This page may have a better example for you.
imagefree
i dont know JS at all. so i need a ready made script by someone.



Edited:

I read this
wylieconlon wrote:
Ah, actually, that doesn't tell you how to apply the code. This page may have a better example for you.


but it is using buttons while i am using images, can you please modify the script to use it for


black.png
blue.png
white.png
files so that when i click on these images, the action takes place.

Thanks
cr3ativ3
imagefree wrote:

Can you please provide me the java code to change the bg color so that it doesnt require more than 1 pages?


Just to let you know it wouldn't be java code your looking for rather Java Script. They may seem like the same language but trust me they are two very different languages.
imagefree
cr3ativ3 wrote:
imagefree wrote:

Can you please provide me the java code to change the bg color so that it doesnt require more than 1 pages?


Just to let you know it wouldn't be java code your looking for rather Java Script. They may seem like the same language but trust me they are two very different languages.


yes i was wrong, i need javascript. Very Happy
wylieconlon
Well, instead of buttons, you're using images. So you'd want to make a link using that image, that calls the function.

For example,

Code:
<a href="javascript:blah()"><img src="url of image"></a>


javascript:blah() means that it will call function blah, which will change the background color. An example of a function to do so would be

Code:
<script language="javascript">
function blah(color)
{
document.bgColor=color
}
</script>


Sorry if that's not very coherent... This may be more helpful.
imagefree
wylieconlon wrote:
Well, instead of buttons, you're using images. So you'd want to make a link using that image, that calls the function.

For example,

Code:
<a href="javascript:blah()"><img src="url of image"></a>


javascript:blah() means that it will call function blah, which will change the background color. An example of a function to do so would be

Code:
<script language="javascript">
function blah(color)
{
document.bgColor=color
}
</script>


Sorry if that's not very coherent... This may be more helpful.



ok, i will place the first code at the right place, but where to place the function itself? In head? or just after the first code???

Please explain more.
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.