1、新建html文档。
2、准备好需要用到的图标。
3、书写hmtl代码。<div class="box"> <div id=NewsLetter1> <div><A href="#"><img src="images/plus.jpg" useMap=#Map > <MAP id=Map name=Map><AREA href="#"><href="#"></MAP></A></div> <div class="fbox"> <ul class=NewsCss2> <li><a href="#">鼠标移1</a></li> <li><a href="#">鼠标移22222 </a></li> <li><a href="#">33333</a></li> <li><a href="#">44444 </a></li> <li><a href="#">5555</a></li> <li><a href="#">66666</a></li> </ul> </div> </div> <div id=NewsLetter2 > <ul class=NewsCss3> <li><a href="#">鼠标移动到加号上显示隐藏的文字内容1</a></li> <li><a href="#">鼠标移动到加号上显示隐藏的文字内容2</a></li> <li><a href="#">jQuery鼠标移动到加号上显示隐藏的文字内容3</a></li> <li><a href="#">鼠标移动到加号上显示隐藏的文字内容4</a></li> <li><a href="#">鼠标移动到加号上显示隐藏的文字内容5</a></li> <li><a href="#">鼠标移动到加号上显示隐藏的文字内容6</a></li> </ul> </div></div>
4、书写css代码。*{ margin: 0; padding: 0; border: 0; }ul, o造婷用痃l, li { list-style: none; }input, button { margin: 0; font-size: 12px; vertical-align: middle; }body { font-size: 12px; font-family: Arial, Helvetica, sans-serif; text-align: center; margin: 0 auto; }table { border-collapse: collapse; border-spacing: 0; }b, em, i { font-style: normal; font-weight: normal; }h1, h2, h3 { font-size: 14px; }h4 { font-weight: normal; font-size: 14px; }h5 { font-size: 12px; }h6 { font-size: 12px; font-weight: normal; }img { display: block; }.pcenter { text-align: center; overflow: hidden; }.pcenter img { margin: 0 auto; }a { text-decoration: none; }a:hover { color: #f00; }.box- { position: relative; text-align: left; z-index: 1000; padding-top: 3px; width: 103px; margin: 20px auto; }#NewsLetter2 { DISPLAY: none; PADDING-LEFT: 5px; background: #333; LEFT: 0px; WIDTH: 215px; PADDING-TOP: 5px; POSITION: absolute; TOP: 13px; HEIGHT: 155px; overflow: hidden; }.box- li { height: 24px; width: 100%; line-height: 24px; float: left; }.box- li a { padding-left: 10px; color: #fff; background: url(../images/News_ico.gif) no-repeat 0 4px; }#NewsLetter2 li a { display: block; width: 200px; white-space: nowrap; text-overflow: ellipsis; -o-text-overflow: ellipsis; background: url(../images/News_ico.gif) no-repeat 0 9px; overflow: hidden; }.fbox { PADDING-RIGHT: 5px; PADDING-LEFT: 5px; overflow: hidden; width: 93px; BACKGROUND: #4e4d4d; PADDING-BOTTOM: 0px; HEIGHT: 155px }
5、书写并添加js代码。var the_timeout;function ShowNewsLetter(Display){ if (Display){ document.爿讥旌护getElementById("NewsLetter2").style.display="block"; clearInterval(the_timeout); }else{ document.getElementById("NewsLetter2").style.display="none"; }}function HideNewsLetter(){ the_timeout = setTimeout("ShowNewsLetter(false);", 100);}function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;}function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}}function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x;}function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}}
6、代码整体结构。
7、查看效果。