about buttons

  • dmx1999
  • Newbie
  • Newbie
  • dmx1999
  • Posts: 12

Post 3+ Months Ago

hello
i want to make a set of buttons that look like this:

|A|B|C|D|E|F|

and the back ground color for all these buttons are white
but then i click a botton, say C, the background in C changes to blue and all others remains the same

and then if i click botton D, C returns to white and now D is in blue...

wonder how i can do that

btw, my botton are organized with tables

thank you
  • b_heyer
  • Web Master
  • Web Master
  • User avatar
  • Posts: 4581
  • Loc: Maryland

Post 3+ Months Ago

I have to write an AP american essay, otherwise i'd try to throw together a script, but you basically want to change the background color style of the cell with an onMouseOver event...something like
Code: [ Select ]
onMouseOver="parent.table.cell.style.background-color='color'"

or something
  • dmx1999
  • Newbie
  • Newbie
  • dmx1999
  • Posts: 12

Post 3+ Months Ago

hm....
mouseover only allows the bgcolor to change when the mouse is pointing at my link
but.... i want the color to change back to white when OTHER links are clicked....

thanks anyway :)
  • b_heyer
  • Web Master
  • Web Master
  • User avatar
  • Posts: 4581
  • Loc: Maryland

Post 3+ Months Ago

then you have to probably make a function that you can use to reset the other bgcolor. Sounds like your are making a tab system?
  • musik
  • Legend
  • Super Moderator
  • User avatar
  • Posts: 6893
  • Loc: up a tree

Post 3+ Months Ago

easy peasy :D

Paste this somewhere in the <head> section and play around with the colour values till you find what you like.


<style type="text/css">
<!--

a:link {color:#000000; text-decoration:none}
a:active {color:#000000; text-decoration:none}
a:visited {color:#000000; text-decoration:none}
a:hover {background-color:#0000FF; text-decoration:none}

-->
</style>




Hope that helps,
Rose :D
  • UNFLUX
  • Genius
  • Genius
  • User avatar
  • Posts: 6375
  • Loc: twitter.com/unflux

Post 3+ Months Ago

i think what he's asking for is the selected page that was clicked, to be
a different color than the others when THAT page is showing.
  • musik
  • Legend
  • Super Moderator
  • User avatar
  • Posts: 6893
  • Loc: up a tree

Post 3+ Months Ago

wouldnt that just be his page background then?

i thought he was talking about his text button menu, for the background of whatever button is going to be clicked to turn blue, then when another is selected it will go back to white.
  • b_heyer
  • Web Master
  • Web Master
  • User avatar
  • Posts: 4581
  • Loc: Maryland

Post 3+ Months Ago

he probably wants something like this:
Code: [ Select ]
/---\/___\/___\
|--------------|
|--------------|
|--------------|
  1. /---\/___\/___\
  2. |--------------|
  3. |--------------|
  4. |--------------|


where the --- are all uniform in color, then when you click on the second tab, the first tab changes back to "__" and the new tab gets the "---" color.
  • dmx1999
  • Newbie
  • Newbie
  • dmx1999
  • Posts: 12

Post 3+ Months Ago

Yes this is what i want (or at least close to )



/---\/___\/___\
|--------------|
|--------------|
|--------------|

I think i will need to reset my bgcolor everytime another link is clicked...
but i dont' have any clue how i can do that with Javascript
  • b_heyer
  • Web Master
  • Web Master
  • User avatar
  • Posts: 4581
  • Loc: Maryland

Post 3+ Months Ago

you have to do something similar to my previous snippet, where you just call the cell that you want changed by its id, and change the color. Hope thta makes sense, I am not the best at JS.
  • musik
  • Legend
  • Super Moderator
  • User avatar
  • Posts: 6893
  • Loc: up a tree

Post 3+ Months Ago

You've totally lost me, wtf is that? lol....
  • dmx1999
  • Newbie
  • Newbie
  • dmx1999
  • Posts: 12

Post 3+ Months Ago

sorry
i lost you
for onmouseover event, here is an example:

http://www.computerhope.com/onmouse.htm#example

like... when you point your mouse at the cell, it will change color, but i am not sure how that is related to changing the color of the clicked cell even after the mouse is gone.
And also, reseting is color to white.... i don't have any idea how to do that :shock:
hm... wonder if this can be done with pure html...
  • musik
  • Legend
  • Super Moderator
  • User avatar
  • Posts: 6893
  • Loc: up a tree

Post 3+ Months Ago

ohhh is that all !_! :wink:

Post Information

  • Total Posts in this topic: 13 posts
  • Users browsing this forum: No registered users and 21 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.