View Full Version : JavaScript and Styles
Tanker
07-17-2002, 07:38 PM
I know that I can use onMouseOver="this.style.color='blue'" to change the color of the text in a tag (not doing this with a link), What I need to do is change the style for the tag, like onMouseOver="this.style="button_up" but this gives me an error, is there an easy way to change the style of a tag (its an input button) via the mouseover/mouseout commands?
premshree
07-17-2002, 08:02 PM
Try this :
<style type="text/css">
.button_d{border:#CCCCCC solid 2px}
.button_up{border:#CCCCCC outset 2px}
</style>
<table class="button_d" onMouseover="this.className='button_up'; return true" onMouseout="this.className='button_d'; return true"><tr><td>Link</td></tr></table>
:thumbsup:
Tanker
07-17-2002, 11:00 PM
Along these same lines is it possible to do a mouseover in an option list that is 3-4 lines visible?
<select name="test" size="4">
<option value="1" SELECTED>1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
Can you do a mouseover/mouseout event to make the lines change so you know which one your on top of?
Thanks for the help.
Mrs G
07-19-2002, 07:13 PM
Here is an example
<form name=magic>
<INPUT TYPE=button name="but" value="Magic button mouse me and see"
onmouseover="document.magic.but.style.backgroundColor='#00AA00',width='290',height='100';
document.magic.but.value='You Can Change The text'"
onmousedown="document.magic.but.style.backgroundColor='FFFF00';
document.magic.but.value='As Easy As The Colour and Size'"
onmouseup="document.magic.but.style.backgroundColor='#FF0000';
document.magic.but.value='Just like this example'"
onmouseout="document.magic.but.style.backgroundColor='#0000FF',height='24';
document.magic.but.value='Coloured button Without Script'">
</form>
For more examples see
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.