jQuery鼠标悬停图片遮罩效果特效代码

版权:原创 更新时间:1年以上
[该文章底部包含文件资源,可根据自己情况,决定是否下载资源使用,时间>金钱,如有需要,立即查看资源]

以下是 jQuery鼠标悬停图片遮罩效果特效代码 的示例演示效果:

当前平台(PC电脑)
  • 平台:

部分效果截图:

jQuery鼠标悬停图片遮罩效果特效代码

HTML代码(index.html):

<!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=gb2312" />
<title>jQuery鼠标悬停图片遮罩效果</title>
<link rel="stylesheet" type="text/css" href="css/zzsc.css" media="all">
<script type="text/javascript" src="js/jquery.min.js"></script>
</head>
<body>
<!-- 代码 开始 -->
<!-- STAR_CONTAINER -->
<div id="container">
<div id="wrap-container" class="clearfix">
        <div class="examples_body">
        
	    <ul class="bannerHolder">
            <li>
            <div class="banner">
                <a href="#" >
                    <img height="125" width="125" alt="The Best Designs" src="images/aloha.jpg" />
                </a>
                <p class="companyInfo">图片信息一</p>
                <div class="cornerTL"></div>
                <div class="cornerTR"></div>
                <div class="cornerBL"></div>
                <div class="cornerBR"></div>
            </div>
            </li>
            <li>
            <div class="banner">
                <a href="#/" >
                    <img height="125" width="125" alt="Mail Chimp" src="images/season1.jpg" />
                </a>
                <p class="companyInfo">图片信息二</p>
                <div class="cornerTL"></div>
                <div class="cornerTR"></div>
                <div class="cornerBL"></div>
                <div class="cornerBR"></div>
            </div>
            </li>
            <li>
            <div class="banner">
                <a href="#/" >
                    <img height="125" width="125" alt="Mail Chimp" src="images/season2.jpg" />
                </a>
                <p class="companyInfo">图片信息三</p>
                <div class="cornerTL"></div>
                <div class="cornerTR"></div>
                <div class="cornerBL"></div>
                <div class="cornerBR"></div>
            </div>
            </li>
            <li>
            <div class="banner">
                <a href="#/" >
                    <img height="125" width="125" alt="Mail Chimp" src="images/slamdunker.jpg" />
                </a>
                <p class="companyInfo">图片信息四</p>
                <div class="cornerTL"></div>
                <div class="cornerTR"></div>
                <div class="cornerBL"></div>
                <div class="cornerBR"></div>
            </div>
            </li>
            <li>
            <div class="banner">
                <a href="#/" >
                    <img height="125" width="125" alt="Mail Chimp" src="images/seagaia_miyazaki.jpg" />
                </a>
                <p class="companyInfo">图片信息五</p>
                <div class="cornerTL"></div>
                <div class="cornerTR"></div>
                <div class="cornerBL"></div>
                <div class="cornerBR"></div>
            </div>
            </li>
        </ul>
        <!-- Examples body -->
        </div>
</div>
<!-- /COPYRIGHT -->
</div>
<!-- END_CONTAINER -->
<script>
$(document).ready(function(){

	// 0.4代表遮罩的透明度
	$('.banner div').css('opacity',0.2);

	$('.banner').hover(function(){
	
		var el = $(this);
		
		// 先淡出阴影,后淡入文字
		el.find('div').stop().animate({width:200,height:200},'slow',function(){

			el.find('p').fadeIn('fast');
		});

	},function(){

		var el = $(this);
		
		// 隐藏文字
		el.find('p').stop(true,true).hide();
		
		// 去掉遮罩
		el.find('div').stop().animate({width:60,height:60},'fast');

	}).click(function(){
		
		// 点击图片时打开链接
		
		window.open($(this).find('a').attr('href'));
		
	});
});
</script>
<!-- 代码 结束 -->
</body>
</html>





CSS代码(zzsc.css):

html,body,p{border:0 none;margin:0;padding:0;outline-style:none;outline-width:0;vertical-align:baseline;font-size:12px;}
/*--------------------------------------------container--------------------------------------------*/
div#container{width:100%;margin:0 auto;overflow:hidden;}
div.examples_body{width:750px;margin:50px auto 0 auto;clear:both;overflow:hidden;position:relative;}
/* The main banner unordered list */
.bannerHolder{width:726px;margin:20px 0 15px 0;padding:20px 10px 20px 10px;background-color:#f7f7f7;border:1px solid #eee;overflow:hidden;/* CSS3 rounded corners */
 -moz-border-radius:12px;-webkit-border-radius:12px;border-radius:12px;}
/* Hiding the bullets of the li elements:*/
.bannerHolder li{list-style:none;display:inline;}
/* The banner divs */
.banner{width:125px;height:125px;position:relative;overflow:hidden;float:left;display:inline;margin:0 10px}
/* The banner divs */
.banner img{display:block;border:none;}
/* The dark animated divs */
.banner div{position:absolute;z-index:100;background-color:#222;width:60px;height:60px;cursor:pointer;/*Setting a really big value for border-radiuswill make the divs perfect circles */
 -moz-border-radius:100px;-webkit-border-radius:100px;border-radius:100px;}
/*Positioning the animated divs outside thecorners of the visible banner area:*/
.banner .cornerTL{left:-63px;top:-63px;}
.banner .cornerTR{right:-63px;top:-63px;}
.banner .cornerBL{left:-63px;bottom:-63px;}
.banner .cornerBR{right:-63px;bottom:-63px;}
/* The "Visit Company" text */
.banner p{width:100%;left:0;top:57px;z-index:200;position:absolute;font-family:Tahoma,Arial,Helvetica,sans-serif;color:#FFF;font-size:11px;text-align:center;cursor:pointer;display:none;/* hidden by default */
}
附件:下载该文件资源,减少时间成本(增值服务)
留言
该资源可下载
File Source
.rar
52.52 KB
Html JS 图片特效2
最新结算
HTML5 3D效果网页视频背景代码
类型: .rar 金额: CNY 2.31¥ 状态: 待结算 详细>
软件概要设计说明书Word下载
类型: .docx 金额: CNY 0.38¥ 状态: 待结算 详细>
软件概要设计说明书Word下载
类型: .docx 金额: CNY 3.02¥ 状态: 待结算 详细>
.net c#获取声卡信息,声卡数量
类型: .rar 金额: CNY 30.96¥ 状态: 待结算 详细>
.net c#获取声卡信息,声卡数量
类型: .rar 金额: CNY 3.87¥ 状态: 待结算 详细>
.net c#获取电脑的安装软件列表信息,包含名称和版本号
类型: .rar 金额: CNY 30.96¥ 状态: 待结算 详细>
.net c#获取电脑的安装软件列表信息,包含名称和版本号
类型: .rar 金额: CNY 3.87¥ 状态: 待结算 详细>
.net c#获取电脑显示适配器信息
类型: .rar 金额: CNY 30.96¥ 状态: 待结算 详细>
.net c#获取电脑的安装软件列表信息,包含名称和版本号
类型: .rar 金额: CNY 3.87¥ 状态: 待结算 详细>
.net c#获取电脑的安装软件列表信息,包含名称和版本号
类型: .rar 金额: CNY 30.96¥ 状态: 待结算 详细>
各执行环节公正透明,帮助企业完成从赛制策划、活动推广、评委评选到版权转让等系列工作,专业、高效、值得信赖。平均每场赛事可征集到数百至数千组源码作品
合作伙伴
联系我们
  • 邮箱:raozetian@hotmail.com
Copyright 2023-2024 eeigg.com·皖ICP备2024038726号-1
打赏文章