很简单的,只需要添加属性就可以了。代码你可以参考:
ul{
list-style-type: none;
}
li {
height: 50px;
width: 200px;
line-height: 50px;
background: #ccc;
color: #333333;
position: relative;
}
.editable {
height: 100px;
width: 200px;
line-height: 20px;
border: 1px solid red;
background: #ccc;
opacity: .5;
color: green;
display: none;
position: absolute;
left: 190px;
top: 10px;
}
-
你是我的小苹果这是一个可以编辑的提示框
var showL = document.querySelector('.showL'),
editable = document.querySelector('.editable');
showL.onmouseover = function() {
editable.style.display = 'block';
}
showL.onmouseout = function() {
editable.style.display = 'none';
}