Home > Web Front-end > JS Tutorial > body text

How to use js mouse to display mask layer_javascript skills

WBOY
Release: 2016-05-16 16:17:27
Original
1278 people have browsed it

The example in this article describes how to display a mask layer when hovering the js mouse. Share it with everyone for your reference. The specific implementation method is as follows:

html page code:

Copy code The code is as follows:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      


js code:





Copy code


The code is as follows:

css代码:

复制代码 代码如下:
ul li{ list-style:none;} 
.site-tag{ width:200px; overflow:hidden; z-index:5;} 
.site-tag li{ position:relative; width:200px; height:50px; margin-bottom:1px; overflow:hidden;  
transition:height 0.5s ease; -webkit-transition:height 0.5s ease;  
-moz-transition:height 0.5s ease; -o-transition:height 0.5s ease;} 
.site-tag li a { color: #666; font-size: 16px; font-weight: bold;line-height: 50px;} 
.site-tag li i{ display:block; height:90px; background-position:center center; 
opacity:0.3; filter:alpha(opacity=3);  /*设置透明度*/ 
-webkit-transition:opacity 0.5 ease;   /**/ 
-webkit-filter:grayscale(60%);         /**/ 

.site-tag li:hover i { opacity:0.9; -webkit-filter:grayscale(0%); transition:opacity 0.5s ease;} 
.tag-tit{ display:block; height:100px; width:700px; color:#666; font-size:14px;}                  
.site-tag li .tag-tit{ position:absolute; top:0px; left:10px; text-shadow:1px 1px 1px rgb(0,0,0,0.1);} 
a:hover .tag-tit{ text-shadow:1px 1px 1px rgb(0,0,0,0.5);}

希望本文所述对大家的javascript程序设计有所帮助。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template