react项目中实现悬浮(hover)在按钮上时在旁边显示提示
<i
className={classNames({
'device-icon': true,
'camera-icon': true,
'camera-icon-hover-show-intro': this.state.shouldVolumeGainBarShow === false,
active: this.state.isCameraOpened === true,
})}
role="button"
tabIndex={0}
onClick={this.handleClickCamera}
labeltooltip="摄像头"
/>
<i
className={classNames({
'device-icon': true,
'mic-icon': true,
'mic-icon-hover-show-intro': this.state.shouldVolumeGainBarShow === false,
active: this.state.shouldVolumeGainBarShow === true,
})}
role="button"
tabIndex={0}
onClick={this.handleClickMic}
labeltooltip="麦克风"
/>
<i
className={classNames({
'device-icon': true,
'wifi-icon': true,
'wifi-icon-hover-show-intro': this.state.shouldVolumeGainBarShow === false,
active: false,
})}
role="button"
tabIndex={0}
onClick={() => {}}
labeltooltip="网络"
/>
<i
className={classNames({
'device-icon': true,
'exit-icon': true,
'exit-icon-hover-show-intro': this.state.shouldVolumeGainBarShow === false,
active: this.state.selectedIconName === SCREEN_SHARE_ICONTABNAME.EXIT,
})}
role="button"
tabIndex={0}
onClick={() => this.handleClickExit(SCREEN_SHARE_ICONTABNAME.EXIT)}
labeltooltip="退出桌面共享"
/>
.device-icon {
width: 24px;
height: 24px;
outline: none;
cursor: pointer;
margin-right: 11px;
position: relative;
&:nth-last-child(2) {
margin-right: 24px;
}
}
.camera-icon {
background: url('~ROOT/shared/assets/image/vn-screen-camera-off-66-66.png') no-repeat center;
background-size: 22px 22px;
&.camera-icon-hover-show-intro {
&:hover:after {
box-sizing: border-box;
height: 24px;
line-height: 24px;
position: absolute;
bottom: -26px;
border-radius: 12px;
background-color: #ffffff;
font-size: 12px;
color: #626e80;
font-style: normal;
cursor: default;
text-align: center;
content: attr(labeltooltip);
width: 58px;
left: -20px;
}
}
&.active {
background: url('~ROOT/shared/assets/image/vn-camera-hover-69-66.png') no-repeat center;
background-size: 23px 22px;
}
}
.mic-icon {
background: url('~ROOT/shared/assets/image/vn-screen-voice-on-54-72.png') no-repeat center;
background-size: 18px 24px;
&.mic-icon-hover-show-intro {
&:hover:after {
box-sizing: border-box;
height: 24px;
line-height: 24px;
position: absolute;
bottom: -26px;
border-radius: 12px;
background-color: #ffffff;
font-size: 12px;
color: #626e80;
font-style: normal;
cursor: default;
text-align: center;
content: attr(labeltooltip);
width: 58px;
left: -20px;
}
}
&.active {
background: url('~ROOT/shared/assets/image/vn-mic-hover-54-72.png') no-repeat center;
background-size: 18px 24px;
}
}
.speaker-icon {
background: url('~ROOT/shared/assets/image/vn-screen-speaker-60-66.png') no-repeat center;
background-size: 20px 22px;
}
.wifi-icon {
background: url('~ROOT/shared/assets/image/vn-screen-wifi-72-57.png') no-repeat center;
background-size: 24px 19px;
&.wifi-icon-hover-show-intro {
&:hover:after {
box-sizing: border-box;
height: 24px;
line-height: 24px;
position: absolute;
bottom: -26px;
border-radius: 12px;
background-color: #ffffff;
font-size: 12px;
color: #626e80;
font-style: normal;
cursor: default;
text-align: center;
content: attr(labeltooltip);
width: 58px;
left: -20px;
}
}
&.active {
background: url('~ROOT/shared/assets/image/vn-wifi-72-72.png') no-repeat center;
background-size: 24px 24px;
}
}
.restart-icon {
background: url('~ROOT/shared/assets/image/vn-screen-restart-60-60.png') no-repeat center;
background-size: 19px 19px;
}
.exit-icon {
background: url('~ROOT/shared/assets/image/vn-screen-exit-60-60.png') no-repeat center;
background-size: 19px 19px;
&.exit-icon-hover-show-intro {
&:hover:after {
box-sizing: border-box;
height: 24px;
line-height: 24px;
position: absolute;
bottom: -26px;
border-radius: 12px;
background-color: #ffffff;
font-size: 12px;
color: #626e80;
font-style: normal;
cursor: default;
text-align: center;
content: attr(labeltooltip);
width: 95px;
left: -35px;
}
}
&.active{
background: url('~ROOT/shared/assets/image/screen-exit-blue-60-60.png') no-repeat center;
background-size: 19px 19px;
}
}
react项目中实现悬浮(hover)在按钮上时在旁边显示提示的更多相关文章
- WPF中当鼠标移到按钮上时,按钮的背景图片消失的问题
如果给按钮设置了背景图片,当鼠标移到按钮上的时候,按钮就好变成一个浅蓝色的按钮,背景图片就消失了,对于这个问题有很多解决方法,我只分享一下我的解决方法. 我第一次用的方式是在按钮中添加一个图片,不用背 ...
- iOS 让按钮上的标题换行显示
项目中遇到了要让按钮上的文字换行显示的需求,就写了这个博客. 1.如果按钮上的文字固定,形式是写死的,可以考虑给标题文字加\n换行符来达到效果,但是,记得一定要设置这个属性,不然是不会换行的, but ...
- React项目中实现右键自定义菜单
最近在react项目中需要实现一个,右键自定义菜单功能.找了找发现纯react项目里没有什么工具可以实现这样的功能,所以在网上搜了搜相关资料.下面我会附上完整的组件代码. (注:以下代码非本人原创,具 ...
- 如何在非 React 项目中使用 Redux
本文作者:胡子大哈 原文链接:https://scriptoj.com/topic/178/如何在非-react-项目中使用-redux 转载请注明出处,保留原文链接和作者信息. 目录 1.前言 2. ...
- 如何优雅地在React项目中使用Redux
前言 或许你当前的项目还没有到应用Redux的程度,但提前了解一下也没有坏处,本文不会安利大家使用Redux 概念 首先我们会用到哪些框架和工具呢? React UI框架 Redux 状态管理工具,与 ...
- react项目中实现元素的拖动和缩放实例
在react项目中实现此功能可借助 react-rnd 库,文档地址:https://github.com/bokuweb/react-rnd#Screenshot .下面是实例运用: import ...
- React项目中使用Mobx状态管理(二)
并上一节使用的是普通的数据状态管理,不过官方推荐使用装饰器模式,而在默认的react项目中是不支持装饰器的,需要手动启用. 官方参考 一.添加配置 官方提供了四种方法, 方法一.使用TypeScrip ...
- 在react项目中使用ECharts
这里我们要在自己搭建的react项目中使用ECharts,我们可以在ECharts官网上看到有一种方式是在 webpack 中使用 ECharts,我们需要的就是这种方法. 我们在使用ECharts之 ...
- 优雅的在React项目中使用Redux
概念 首先我们会用到哪些框架和工具呢? React UI框架 Redux 状态管理工具,与React没有任何关系,其他UI框架也可以使用Redux react-redux React插件,作用:方便在 ...
随机推荐
- 使用python写的一个代码统计程序
# encoding="utf-8" """ 统计代码行数 """ import sys import os def c ...
- Mac下vim7.4+vimgdb让vim支持gdb源码调试
下载vimgdb https://github.com/cpiger/vimgdb-for-vim7.4 下载vim7.4源码 将两个文件或者文件夹放到同一个目录解压 tar xjvf vim-7.4 ...
- vue组件弹窗
定义弹窗组件 先写一个普通的vue组件,其显示的内容就是弹窗的内容. 文件的位置 /src/views/toast/toast.vue <template> <div class=& ...
- ubuntu16.04 backup and restore
http://blog.csdn.net/qq_35523593/article/details/78545530
- 关于html/css的一些小技巧之hack掉"margin-top"层叠问题
身为小前端菜鸟一枚,忽然听到这样一则传言~~ 心情久久不能平复,想到前几日,开通了博客君,特来此寻找存在feeling~ 旨在造福普罗大众(更多前端小菜鸟) 话不多说, 我们步入正题,今天来给大家分享 ...
- VMware复制CentOS7,网络配置问题处理
问题: vm安装CentOS7,静态IP配置完毕后,关闭虚机1,克隆虚拟机为2.克隆出来的虚拟机使用ip addr命令,发现网卡但和之前名称完全不一样变成ens33,也没有ip地址,但/etc/sys ...
- 小程序 components 下的组件引入字体图标时样式不生效
在组件内的样式在引入一遍 字体图标样式, pages 下的组件不受影响,全局引入字体图标样式即刻,不需要再次引入
- 使用HTML meta no-cache标签来禁用缓存
使用HTML meta no-cache标签来禁用缓存 如何完美滴使浏览器访问一个 HTML 页面时禁用缓存?在测试某个 SPA 项目时,发现更改后 Chrome 浏览器页面刷新还是使用之前的版本.经 ...
- nodejs基础快速上手
node 快速了解 hello node.js console.log("hello Node.js"); let http = require("http") ...
- AHOI2019游记
day0 早上八点钟出发,下午一点左右到了(高速好堵啊) 下午试机,打了一发线段树,堆和其他一些东西,测试完没有问题就走了 惊奇发现旁边竟然是合肥市队的WC银牌hzy,%%% 晚上%了一发金牌爷yg就 ...