基于jquery实现的文字淡入淡出效果


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<title>无标题文档</title> 
<script type="text/javascript" language="javascript" src=""> 
</script> 
<script language="javascript"> 
$(document).ready(function(){ 
    $("#btn1").toggle(function(){ 

            $("p").fadeOut("slow"); 
            },function(){ 
                $("p").fadeIn("slow");    

        }); 
        $("#btn2").toggle(function(){ 

            $("p").fadeTo("slow",0.66); 
            },function(){ 
                $("p").fadeTo("slow",0.66);  
        });  
    }); 

</script> 
</head> 

<body> 
<p>this is pi<br> 
this is pi<br> 
this is pi<br> 
this is pi<br> 
this is pi<br> 
this is pi<br> 
</p> 
<input type="button" value="淡入/淡出"> 
</body> 
<input type="button" value="淡入/淡出 效果 透明度0.66"> 
</html> 

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wdwpgg.html