Click to See Complete Forum and Search --> : making a button "pressed"
pelegk1
07-08-2003, 07:01 AM
i have a button that when i press on "k" for example
i want to make a certain button to be seemed like it was pressed!
how do i do it?
thanks in advance
Peleg
Probably by changing it's styles via CSS...
freefall
07-08-2003, 07:59 AM
Here's pyro's plan in action. This doesn't simulate the black box around the active button nor the dotted line around the inside but if you want to be that specific, make the second button into two images, one clicked, one not.
<form>
<input type="button" name="b1" value="Click Me!" onmousedown="document.forms[0].b2.style.cssText = 'border-style: inset; border-left-color: #666B63; border-top-color: #666B63; border-right-color: #CDCFCB; border-bottom-color: #CDCFCB;';" onmouseup="document.forms[0].b2.style.cssText = 'border-style: outset; border-left-color: #CDCFCB; border-top-color: #CDCFCB; border-right-color: #666B63; border-bottom-color: #666B63;';"><br><br>
<input type="button" name="b2" value="I click too!">
</form>
- Ian
pelegk1
07-08-2003, 08:19 AM
but sing the intranet dev css
that when i press on the button it will change using the class i defined in the css
freefall
07-08-2003, 08:41 AM
You got it! This is just how I tested it, you'll have your ext script, works just fine that way, too!
// HTML file
<link rel="stylesheet" type="text/css" href="test.css">
<form>
<input type="button" name="b1" value="Click Me!" onmousedown="document.forms[0].b2.className = 'clicked';" onmouseup="document.forms[0].b2.className = 'unclicked';"><br><br>
<input type="button" name="b2" value="I click too!">
</form>
// CSS file
.clicked { border-style: inset; border-left-color: #666B63; border-top-color: #666B63; border-right-color: #CDCFCB; border-bottom-color: #CDCFCB; }
.unclicked { border-style: outset; border-left-color: #CDCFCB; border-top-color: #CDCFCB; border-right-color: #666B63; border-bottom-color: #666B63; }
- Ian