<script>
var thefont
var i=0,j=0
var thefonts=new Array()
function showit(obj){
thefont=obj
e=event.srcElement
t=e.offsetTop; 
l=e.offsetLeft;
while(e=e.offsetParent){
t+=e.offsetTop;
l+=e.offsetLeft;}
tips.style.display=""
tips.style.left=l+event.srcElement.offsetWidth
tips.style.top=t+event.srcElement.offsetHeight
expan()
 }
function hideit(){
tips.style.display="none"
tips.style.width=0
tips.style.height=0
tips.innerHTML=""
i=0
j=0
}
function showmessage(){
thefonts=thefont.split("")
addfont()
}
function addfont(){
if(j<thefonts.length){
tips.innerHTML="<font color=black>"+tips.innerText+"</font><font color=white>"+thefonts[j]+"</font>"
setTimeout("addfont()",50)
}
j++
}
function expan(objs){
if(i<150){
tips.style.width=i*2
tips.style.height=i*1
setTimeout("expan()",10)
}
else
if(i==150)
showmessage()
i++
}
</script>
<style type=text/css>
a {font-size:14px;color:#666666;font-family:"tahoma";text-decoration: none}
span{font-size:12px;color:black;font-family:Verdana;border:1 solid gray}
</style>
<a href="#" onmouseover="showit('123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123.')" onmouseout=hideit()>123</a>
<span id=tips style="position:absolute;width:0px;height:0px;background:#cccccc;display:none;filter: Alpha(opacity=60)"></span>

解决方案 »

  1.   

    <p onmouseover="aaa()" onmouseout="document.all.ddd.style.width=10;document.all.ddd.style.height=10;">展开</p>
    <div id="ddd" style="border:1px;width:10;height:10;background:#D0D0FF;border: 1px;"></div><SCRIPT LANGUAGE="JavaScript">
    <!--
    function aaa(obj){
    var ww=parseInt(document.all.ddd.style.width);
    var hh=parseInt(document.all.ddd.style.height);
    if(ww < 200){
    ww = ww + 1;
    document.all.ddd.style.width=ww;
    setTimeout('aaa(' + ww + ')',100)
    }
    if(hh < 200){
    hh = hh + 1;
    document.all.ddd.style.height=hh;
    setTimeout('aaa(' + hh + ')',100)
    }
    }
    //-->
    </SCRIPT>