View Full Version : javascript buttons
trinibob
11-02-2002, 06:46 PM
if u create a button by the following code...
<input type = "button" value ="clear" name ="clearbutton" />
how can this button operate such that when the user moves the mouse pointer over the button,it should become highlighted.,otherwise it should be displayed normally
cg9com
11-02-2002, 06:56 PM
heres the way i would do it
first create the class names in a <style> tag
<style>
.button {
width:70;
height:20;
background-color:#153786;
color:white;
font:bold 8pt arial;
border:2px outset #4376DC
}
.buttonOverClass {
width:70;
height:20;
background-color:#153786;
color:white;
font:bold 8pt arial;
border:2px inset #4376DC
}
</style>
then create the buttons with the proper mouseover and class names
<input type=button value=Button class=button
onmouseover="this.className='buttonOverClass';"
onmouseout="this.className='button';">
hope this helps :)
trinibob
11-02-2002, 08:04 PM
Tanks alot cg9com ....no javascript there.....just css....thanks.
i am new to this.....so i was confused
cg9com
11-02-2002, 10:18 PM
onmouseover/onmouseout is javascript
Deanna475
02-09-2003, 08:21 AM
Thanks for the answer to this question, cg9com. It told me exactly what I wanted to know. Now I'm just wondering .... is it possible to add transition effects to a CSS button as one can to a page? I think it would really jazz up my buttons if I could make them "dissolve" (for example) rather than just highlight on mouseover.
cg9com
02-09-2003, 05:38 PM
if you could, i dont know how lol
im thinking dhtml, or java :)
or .......... flash :(
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.