ciao goi
eccoti un esempio da cui prendere spunto
codice:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=windows-1250"> <meta name="generator" content="PSPad editor, www.pspad.com"> <style> .menu_voce { border: 1px solid red; height: 35px; width: 170px; color: green; } #voce { float: left; border: 1px solid gray; width: 138px; } #side_block_off { float: left; width: 30px; height: 35px; background-color: black; } #side_block_on { float: left; width: 30px; height: 35px; background-color: red; } </style> <script> function init() { var coll=document.getElementsByTagName('div'); for (var x=0; x < coll.length; x++) { if (coll[x].className == 'menu_voce') { coll[x].onmouseover=function(){this.getElementsByTagName('div')[1].id='side_block_on'} coll[x].onmouseout=function(){this.getElementsByTagName('div')[1].id='side_block_off'} } } } </script> <title></title> </head> <body onload="init()"> <div class="menu_voce"> <div id="voce">voce di menu</div> <div id="side_block_off"></div> </div> </body> </html>![]()




Rispondi quotando