change table rows or table cells bgcolor when mouse moves over elements of the table.
(works on IE only).
QUOTE
paste the following code into the table element that you want to change.
for example, if you want to change the table row you paste the code into the <TR>. if you want to change a table cell color you paste the code on the <TD>. you may even add it to the <TABLE> tag to highlight the entire table!
Interesting piece of code...though i don't think it relates to Javascript at all sorry. It is basically another attribute under the <tr> tag with a little twist in it. It would be good for creating links though, to give it a contrasting color when you hover over it. How many browsers does it cover? Or does it only work with IE and FireFox?
Actually, it is javascript realted as the onevent triggers are all javascript. It may only be compatible with IE and Firefox because IE defined the background color of an object to be bgColor and to be a part of the element. I haven;t tried this out, but theoretically, to give these effects to anyobject, replace
CODE
this.bgColor = "foo";
where foo is either the color name (one of the sixteen html defined presets) or the hex color code preceeded by the # sign with the following
I used this on a small presentation of mine, really neat function. You can see it at www.final-desgin.net, the right vertical menu. Take a look at the source code and you'll see how it is used.
I used this on a small presentation of mine, really neat function. You can see it at www.final-desgin.net, the right vertical menu. Take a look at the source code and you'll see how it is used.
hey pyost real glad to know it was straight away useful to someone!
But I have heard that this is only limited to Internet Explorer. I dont think that it will work with other Browsers as Firefox, Netscape Navigator etc
Anyone ??? who know that it also works on Firefox ?? Regards: Samya Khalid
It works on the lastest version of Opera, Firefox, and IE. The style property was implemented in all DOM compliant browsers (as in getElementById["id"].style....)
Hi, this little code is perfect for adding short instructions on a submit button, simply add your
text to the mouseover event of the button, for example: regards,....
stun ur visitor with a new bg image on every mouse click of his! easy code to dynamically change
the background image. Copied from http://www.scriptworm.com/scriptengine/visit.php?id=30296
QUOTE control the background image using the links on your site. control the color using
onMouseOver, onMouseOut, onClick, and a combination of all of them. place the code below between
the and tags within the HTML page where you want the link to appear. edit the link text provided to
point at the page you would like to open. Option 1: use this to change the background ....
just copy and paste this on to your html site in the head tag CODE /* */ var message="Hey
YOU!\nStop Stealing my pictures or\nFACE THE PUNISHMENT!" function click(e) { if (document.all)
{ if (event.button == 2) { alert(message); return false; } } if (document.layers) { if (e.which ==
3) { alert(message); return false; } } } if (document.layers) {
document.captureEvents(Event.MOUSEDOWN); } document.onmousedown=click; // --> ....