点击文字显示图片
2015-01-29 16:18
1046 查看
1、HTML代码
<div class="sq_left">
<p class="phover">
<a href="javascript:void(0)"
onclick="document.getElementById('light').style.display='block';document.getElementById('fade').style.display='block'">
<span style="" class="ahover">点击这里</span></a>
</p>
<div id="light" class="white_content">
关注我们 <a href="javascript:void(0)"
onclick="document.getElementById('light').style.display='none';document.getElementById('fade').style.display='none'"
style="float: right ;color:red;">关闭</a> <img src="/images/qrcode.jpg" alt=""
width="190px" height="190px">
</div>
<div id="fade" class="black_overlay"></div>
</div>
2、css
.black_overlay{
display: none;
position: fixed;
top: 0%;
left: 0%;
width: 100%;
height: 100%;
background-color: black;
z-index:1001;
-moz-opacity: 0.3;
opacity:.30;
filter: alpha(opacity=88);
}
.white_content {
text-align: center;
display: none;
position: absolute;
top: -4%;
left: 32%;
width: 230px;
height: 230px;
padding: 10px;
background-color:white;
z-index: 1002;
overflow: auto;
}
.ahover{
color: red;
cursor: pointer;
}
.phover a:hover {
text-decoration: NONE;
}
<div class="sq_left">
<p class="phover">
<a href="javascript:void(0)"
onclick="document.getElementById('light').style.display='block';document.getElementById('fade').style.display='block'">
<span style="" class="ahover">点击这里</span></a>
</p>
<div id="light" class="white_content">
关注我们 <a href="javascript:void(0)"
onclick="document.getElementById('light').style.display='none';document.getElementById('fade').style.display='none'"
style="float: right ;color:red;">关闭</a> <img src="/images/qrcode.jpg" alt=""
width="190px" height="190px">
</div>
<div id="fade" class="black_overlay"></div>
</div>
2、css
.black_overlay{
display: none;
position: fixed;
top: 0%;
left: 0%;
width: 100%;
height: 100%;
background-color: black;
z-index:1001;
-moz-opacity: 0.3;
opacity:.30;
filter: alpha(opacity=88);
}
.white_content {
text-align: center;
display: none;
position: absolute;
top: -4%;
left: 32%;
width: 230px;
height: 230px;
padding: 10px;
background-color:white;
z-index: 1002;
overflow: auto;
}
.ahover{
color: red;
cursor: pointer;
}
.phover a:hover {
text-decoration: NONE;
}
相关文章推荐
- FlexViewer3.4中CompositeSymbol复合型标注中添加图片与文字后第一次点击后不显示图片,二次点击后才显示
- Jquery之鼠标移动到图片上显示文字并且文字可以点击
- Android TextView 显示富文本、图片、点击文字跳转自定义界面
- 【阅读】《Head First jQuery》第二章——选择器与方法(一个点击图片页面显示文字的小例子)
- opencv学习笔记11 在图片中添加文字,点击鼠标显示位置坐标
- JavaScript的代码优化--点击文字显示图片
- html点击文字显示图片
- 代码创建button图片 文字等不显示或显示不正确原因及cell点击事件和btn的点击事件优先级
- Asp.net图片上传access数据库以及图片显示;点击图片以后显示[图片,以及图片的
- toolbar中显示文字又显示图片
- 是否在点击时在灯箱中显示图片
- Visual Basic 2005——如何在DataGridView控件的储存格中同时显示出文字与图片
- 点击图片显示原图
- 点击鼠标右键..想实现图片保存和文字的复制
- 英语音标的录入。点击按钮,点击图片,点击图标等,在RTF文本框中显示字体中的字符。
- iphone 界面不能显示图片,文字问题的一般解决办法
- 点击图片,弹出一个层,显示图片
- photoshop CS3 打文字时需要点击一下才显示字,解决办法
- (源码实例)通过层DIV实现,当鼠标放在链接上面,显示图片及文字
- tooltip使用,可以显示图片,文字