Log in

View Full Version : Buttons



superflytrainer
03-17-2006, 05:26 PM
I'm in the process of making a blog and i would like a button that says blog on it and looks 3d not the type you can make by using form and button. Is this more grphics than html and if so can anyone point to a source code. Thanks a lot!!

Twey
03-17-2006, 05:36 PM
Being as you've posted this in the HTML forum, I'll presume you've already got the graphics you want (normal, pressed and mouseover [optional]). In this case, you need to preload the images:

<script type="text/javascript">
(new Image()).src = "blogButton_normal.png";
(new Image()).src = "blogButton_mouseover.png";
(new Image()).src = "blogButton_pressed.png";
</script>Then, create the button like so:
<img
src="blogButton_normal.png"
onmouseover="this.src = 'blogButton_mouseover.png';"
onmouseout="this.src = 'blogButton_normal.png';"
onmousedown="this.src = 'blogButton_pressed.png';"
onmouseup="this.src = 'blogButton_normal.png';"
>Remove the mouseover and mouseout events if you don't want to use a hover effect.