»
EnglishFrenchVietnamese

Print - DHTML Rollovers - JavaScriptBank.com

Full version: jsB@nk » Menu » DHTML Rollovers
URL: https://www.javascriptbank.com/dhtml-rollovers.html

DHTML Rollovers © JavaScriptBank.comThe demonstration JavaScript menu bar above is produced solely by a style sheet in the HEAD section, plus HTML, and uses a JavaScript to switch styles when the mouse is passed over the items in the menu. There is no need for graphics at all. Unfortunately it only works with Internet Explorer 4 and later, so it is not of much use at present.Note: If you use this JavaScript, make sure it is placed after the items in the menu, not in the HEAD of the document.

Full version: jsB@nk » Menu » DHTML Rollovers
URL: https://www.javascriptbank.com/dhtml-rollovers.html



CSS
<STYLE type=text/css>.Item {FONT-SIZE: 20px; CURSOR: hand; COLOR: white; FONT-STYLE: normal; FONT-FAMILY: verdana; BACKGROUND-COLOR: navy}.Highlight {FONT-SIZE: 20px; CURSOR: hand; COLOR: blue; FONT-STYLE: italic; FONT-FAMILY: verdana; BACKGROUND-COLOR: red}</STYLE><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


JavaScript
<SCRIPT language=JavaScript><!--function rollon() {  if (window.event.srcElement.className == "Item") {     window.event.srcElement.className = "Highlight";  }}Rollover.onmouseover = rollon;function rolloff() {  if (window.event.srcElement.className == "Highlight") {     window.event.srcElement.className = "Item";  }}Rollover.onmouseout = rolloff;//--></SCRIPT><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<DIV id=Rollover align=center><SPAN class=Item>Milk</SPAN> <SPAN class=Item>Eggs</SPAN> <SPAN class=Item>Ham</SPAN> <SPAN class=Item>Cheese</SPAN> <SPAN class=Item>Pasta</SPAN> <SPAN class=Item>Chicken</SPAN> </DIV><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->