Advertisement

Need HTML snippet to make button and change color on mouse over

Started by January 18, 2002 09:18 AM
6 comments, last by Promit 22 years, 8 months ago
I don''t know any HTML and im trying to steal a few points of EC. i need the answer in about 2 hours(by noon EST), if possible. I originally did this in VB, which took less than a minute. I ned a button on the HTML document, and when the mouse moves over it, it needs to change color. When the mouse moves off, it needs to change back. I believe this is known as a "rollover" button. ----------------------------- The sad thing about artificial intelligence is that it lacks artifice and therefore intelligence.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
you do it with a java-script, or even in a flash animation. it requires you to make an image of the origional image, then recolor it to the color you want, if you want to do it in java-script. or if you want to imbed a flash movie into your document you can do it in flash. for that read up the tutorial on buttons in flash 5 if you have it.

sorry i dont know the java-script code offhenad
War is how Americans learn geography.
Advertisement
In the head put this

<style type="text/css">
td.over {background-color: #FF0000;}
td.clicked {background-color: #FFFFFF;}
</style>

for the buttons make them table cells and look at this

<table>
<tr>
<td bgcolor="#00FF00" classover="over" classdown="clicked">
Stuff
</td>
</tr>
</table>

Edited by - garconbifteck on January 18, 2002 11:06:55 AM
OR you can do it with java-script as lugie says:

<table border="2" bordercolor="#C0C0C0" width="100%" height="100%" bgcolor="#3B3939" nonostyle="BORDER-COLLAPSE: collapse">
<tr>

<td align=center width="15%" bgcolor="#3B3939" overonmouse="this.style.background = '#939393';this.style.cursor = 'hand'" onmouseout="this.style.background = '#3B3939'" whenclickedon="document.location.href = 'index2.asp?zone=news.htm'">

News

</td>
<td align=center width="14%" bgcolor="#3B3939" overonmouse="this.style.background = '#939393';this.style.cursor = 'hand'" onmouseout="this.style.background = '#3B3939'" whenclickedon="document.location.href = 'index2.asp?zone=reviews.htm'">

Reviews

</td>
<td align=center width="14%" bgcolor="#3B3939" overonmouse="this.style.background = '#939393';this.style.cursor = 'hand'" onmouseout="this.style.background = '#3B3939'" whenclickedon="document.location.href = 'index2.asp?zone=previews.htm'">

Previews

</td>
<td align=center width="14%" bgcolor="#3B3939" overonmouse="this.style.background = '#939393';this.style.cursor = 'hand'" onmouseout="this.style.background = '#3B3939'" whenclickedon="document.location.href = 'index2.asp?zone=editorials.htm'">

Editorials

</td>
<td align=center width="14%" bgcolor="#3B3939" overonmouse="this.style.background = '#939393';this.style.cursor = 'hand'" onmouseout="this.style.background = '#3B3939'" whenclickedon="document.location.href = 'index2.asp?zone=cheats.htm'">

Cheats

</td>
<td align=center width="14%" bgcolor="#3B3939" overonmouse="this.style.background = '#939393';this.style.cursor = 'hand'" onmouseout="this.style.background = '#3B3939'" whenclickedon="document.location.href = 'index2.asp?zone=mailbag.htm'">

MailBag

</td>
<td align=center width="15%" bgcolor="#3B3939" overonmouse="this.style.background = '#939393';this.style.cursor = 'hand'" onmouseout="this.style.background = '#3B3939'" whenclickedon="document.location.href = 'index2.asp?zone=chatbox.htm'">

chaT boX

</td>

</tr>
</table>

(I just copy and pasted that from my new layout which is found here

Edited by - garconbifteck on January 18, 2002 11:09:53 AM
Could i please jsut have something i can copy-paste directly into notepad and save?

I only have half an hour left...

-----------------------------
The sad thing about artificial intelligence is that it lacks artifice and therefore intelligence.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
no, you cant, because we dont know what you''re trying to make, the image names, and all of that... even if i did know i wouldnt make it for you.
War is how Americans learn geography.
Advertisement
quote: Original post by Promit
Could i please jsut have something i can copy-paste directly into notepad and save?

I only have half an hour left...

-----------------------------
The sad thing about artificial intelligence is that it lacks artifice and therefore intelligence.


Looks to me like they did, except you''d have to change the names of items a bit if the question asked for some specific id values for the buttons and such.
BeSIt's Da BOMB Baby!!!. o O ~ A little nonsense now and then,is relished by the wisest men~ O o .-- Willy Wonka
freak, they did give you examples you could cut and paste.

This topic is closed to new replies.

Advertisement