您现在的位置: 万盛学电脑网 >> 程序编程 >> 网络编程 >> 安卓开发 >> 正文

怎么制作html5渐显的文字提示效果?

作者:佚名    责任编辑:admin    更新时间:2022-06-22

下面我们给大家介绍一下制作html5渐显的文字提示效果的方法吧!希望大家可以在这里学习!

<html>

<head>

<title>网页特效-文本特效-渐显的文字提示效果</title>

<FCK:meta http-equiv="content-Type" content="text/html;charset=gb2312" />

<!--把下面代码加到<head>与</head>之间-->

<style type="text/css">

.lookMe{

float:left;

margin-right:10px;

padding:5px;

width:90px;

color:#0099FF;

cursor:pointer;

background:#FFFADC;

border:1px solid #CC6600;

}

.lookMe span{

display:none;

position:absolute;

padding:5px;

width:200px;

color:#CC3300;

background:#FFFADC;

border:1px solid #CC6600;

filter:alpha(opacity=0);

}

</style>

</head>

<body>

<!--把下面代码加到<body>与</body>之间-->

<div onmouseover_fckprotectedatt="%20onmouseover%3D%22lookMe(this)%3B%22" class="lookMe" onmousemove_fckprotectedatt="%20onmousemove%3D%22mouseMove(event)%3B%22">闷战120分钟点球战4:2 西班牙破魔咒淘汰意大利

<span>1、雅虎体育讯 北京时间6月23日,欧洲足球锦标赛在瑞士奥地利继续进行,在一场四分之一决赛中,西班牙队迎来了上届世界杯冠军意大利队,90分钟与加时赛双方均一球未进,在最终的点球大战中,西班牙4:2击败了对手,昂首挺进四强。</span>

</div>

<div onmouseover_fckprotectedatt="%20onmouseover%3D%22lookMe(this)%3B%22" class="lookMe" onmousemove_fckprotectedatt="%20onmousemove%3D%22mouseMove(event)%3B%22">闷战120分钟点球战4:2 西班牙破魔咒淘汰意大利

<span>2、在一场四分之一决赛中……</span>

</div>

<div onmouseover_fckprotectedatt="%20onmouseover%3D%22lookMe(this)%3B%22" class="lookMe" onmousemove_fckprotectedatt="%20onmousemove%3D%22mouseMove(event)%3B%22">闷战120分钟点球战4:2 西班牙破魔咒淘汰意大利

<span>3、欧洲足球锦标赛在瑞士奥地利继续进行,在一场四分之一决赛中,西班牙队迎来了上届世界杯冠军意大利队,90分钟与加时赛双方均一球未进,在最终的点球大战中,西班牙4:2击败了对手,昂首挺进四强。</span>

</div>

<script>

var span,timer1;

function lookMe(thisTag){

         span = thisTag.getElementsByTagName('span')[0];

 span.style.display = 'block';

         span.filters[0].opacity=0;

         timer1=setInterval("showme()",10)         

 thisTag.onmouseout = function(){

  span.style.display = 'none';

 }

}

function showme()

{

   if(span.filters[0].opacity==80){clearInterval(timer1)}

   span.filters[0].opacity++

}

function mouseMove(event){

 var xx=event.clientX + 5;

 var yy=event.clientY + 10;

 var obj = event.srcElement ? event.srcElement : event.target;

         var span=obj.getElementsByTagName("span")[0];

 span.style.left = xx + 'px';

 span.style.top = yy + 'px';

}

</script>

</body>

</html>

以上就是我们给大家介绍的html5渐显的文字提示效果的方法了。希望大家继续关注我们的网站!