HTML+CSS+JS 简单Tooltip
来源:互联网 发布:小米主题破解软件 编辑:程序博客网 时间:2024/06/09 03:16
效果图一:
HTML:
<div class="dont_workbench_power_response_parent">
<div class="list-item-response dont_workbench_power_response_icon">
<input class="participate-in-demand this_user_response_old" style="width: 200px; height:36px;" type="button" value="无权限参与"/>
</div>
<div class="dont_workbench_power_response">
<span>提示文字</span>
<div class="triangle-border tb-border"></div>
<div class="triangle-border tb-background"></div>
</div>
</div>
CSS:
.dont_workbench_power_response_parent{position: relative;}.dont_workbench_power_response{position: relative;width: 210px;height: 55px;background: #232323;box-shadow: 1px 1px 1px #232323;border: 1px solid #232323;text-align: center;color: #fff;left: -7px;top: -120px;border-radius: 4px;filter: alpha(opacity=80);-moz-opacity: 0.8;-khtml-opacity: 0.8;opacity: 0.8;display: none;line-height: 27px;}.dont_workbench_power_response span{margin: 0;}.triangle-border {position: absolute;left: 95px;overflow: hidden;width: 0;height: 0;border-width: 10px;border-style: solid dashed dashed dashed;}.tb-border {bottom:-20px;border-color:#232323 transparent transparent transparent;}.tb-background {bottom:-19px;border-color:#232323 transparent transparent transparent;}
jQuery('.dont_workbench_power_response_icon').mouseover(function(){
jQuery('.dont_workbench_power_response').show();
}).mouseout(function(){
jQuery('.dont_workbench_power_response').hide();
});
扩展:
设置通用的透明度:{
filter:alpha(opacity=50);
-moz-opacity:0.5;-khtml-opacity: 0.5;opacity: 0.5;
}
效果图二:
css:
div.operation-authority-content-div{
height: 48px;
text-align: center;
color: #b4b5b5;
position: relative;
line-height: 48px;
}
.cancel_response_requirement_tip{
position: absolute;
width: 300px;
bottom: 43px;
border: 1px solid #ccc;
left: -112px;
z-index: 10;
display: none;
background: #fff;
border-radius: 3px;
padding: 10px;
text-align: left;
}
.cancel_response_requirement_tip > s{
position: absolute;
bottom: -20px;
left: 150px;
display: block;
height: 0;
width: 0;
font-size: 0;
line-height: 0;
border-color: #cccccc transparent transparent transparent;
border-style: solid dashed dashed dashed;
border-width: 10px;
}
.cancel_response_requirement_tip > s > i{
position: absolute;
top: -11px;
left: -10px;
display: block;
height: 0;
width: 0;
font-size: 0;
line-height: 0;
border-color: #ffffff transparent transparent transparent;
border-style: solid dashed dashed dashed;
border-width: 10px;
}
.cancel_response_requirement_tip > p{
margin: 0;
word-wrap: break-word;
white-space: normal;
word-break: break-all;
color: rgb(51, 51, 51);
line-height: 20px;
}
.cancel_response_requirement_tip > p > span{
font-weight: bold;
}
HTML:
<div class="operation-authority-content-div">
<img class="cancel-response-requirement-not-function" src="../images/cancel_response_requirement_grey.png"/>
<div class="cancel_response_requirement_tip" style="display: none;">
<p><span>剔出参与者状态:</span>审核中</p><p><span>剔出参与者时间:</span>2015-06-30 09:39:36</p><p><span>剔出参与者原因:</span> jQuery('#requirement_response_upload_title').text('踢出参与者');</p>
<s>
<i></i>
</s>
</div>
</div>
JS:
jQuery('div.operation-authority-content-div img.cancel-response-requirement-not-function').live('mouseover',function(){
jQuery(this).siblings('div.cancel_response_requirement_tip').show();
}).live('mouseleave',function(){
jQuery(this).siblings('div.cancel_response_requirement_tip').hide();
});
0 0
- HTML+CSS+JS 简单Tooltip
- html + css + js初步简单学习笔记
- HTML+CSS+JS 简单的计算器
- js css+html实现简单的日历
- js实现的tooltip简单小组件
- 制作一张简单的网页(HTML+CSS+JS)【1】
- 制作一张简单的网页(HTML+CSS+JS) 【2】
- 制作一张简单的网页(HTML+CSS+JS) 【3】
- Html+css+js+jquery实现简单页面登录
- 简单调试前端 html js css woff ok
- 简单的公告墙HTML+CSS样式+angular.js
- html,css.js
- html+css+js+struts
- js html css
- HTML,JS,CSS教程
- html css js 进度条
- JS, HTML, CSS 大全
- web001-html,css,js
- caffe的log输出
- jqGrid设置指定行的颜色
- Android 判断应用前后台运行状态并获取当前 Activity 实例
- iframe用法
- markdown中的锚点 及其使用
- HTML+CSS+JS 简单Tooltip
- Android性能优化-UI性能优化
- weex和Android的交互
- index_merge引发的死锁排查
- 二维数组的各种sizeof问题
- C++ 中string类型和 C风格 char类型字符串比较
- Struts2(二) 配置文件struts2.xml的编写
- 动态规划--最长递增(减)子队列.[九度1112][递推求解]
- 设计模式——状态模式