基于jquery单击图片弹出显示的简单实现

单击图片可以弹出显示,代码如下:

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="jquery-1.4.2.min.js"></script>
    <title>单击图片弹出显示</title>
	<style type="text/css">
	.theme-popover-mask{z-index:1;position:absolute;left:0;top:0;width:100%;height:100%;background:#000;opacity:0.5;filter:alpha(opacity=50);-moz-opacity:0.5;display:none;}
	.theme-popover{z-index:9;position:absolute;top:50%;left:50%;width:660px;height:400px;margin:-180px 0 0 -330px;border-radius:5px;border:solid 2px #e4e4e4;background-color:#fff;display:none;box-shadow:0 0 10px #666;background:#fff;}
	.theme-poptit{border-bottom:1px solid #ddd;padding:12px;position:relative;height:36px;}
	.theme-poptit .close{float:right;color:#999;padding:5px;margin:-2px -5px -5px;font:bold 14px/14px simsun;text-shadow:0 1px 0 #ddd}
	.theme-poptit .close:hover{color:#444;}
	.theme-popbod{padding:60px 15px;color:#444;height:148px;}
	.dform{padding:10px 30px 40px;text-align:center;}
	</style>
<script type="text/javascript">
		$(document).ready(function($){

            $('.theme-login').click(function(){
				var path=$("#picture").attr("src");
				$('.theme-popover-mask').show();
				$('.theme-popover-mask').height($(document).height());
				$("#home_showpic").attr("src",path);
				$('.theme-popover').slideDown(200);
            })
            $('.theme-poptit .close').click(function(){
                $('.theme-popover-mask').hide();
                $('.theme-popover').slideUp(200);
            })

        });

    </script>
</head>
<body>
<img src="1.jpg" style="height: 60px;width: 96px" id="picture" class="theme-login" οnclick="home_showpicFun()" />
	<div class="theme-popover-mask"></div>
<div class="theme-popover">
    <div class="theme-poptit">
        <a href="javascript:home_closepicFun();" title="关闭" class="close">×</a>
        <h3>优秀,是一种态度!</h3>
    </div>
    <div class="theme-popbod dform">
        
      <img id="home_showpic" style="height: 300px;width: 480px"/>
                
            
    </div>
</div>

</body>
</html>
点击下载源码

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值