bad*_*ard 5 html javascript css jquery angularjs
有没有人知道在 HTML 元素上悬停时滑动长文本的 Angular 指令?如果可能的话,我不喜欢使用 jQuery 插件。
目前,文本正在使用 css 截断,但我希望能够在将鼠标悬停在其上时向用户显示剩余的字符。
任何替代解决方案也受到热烈欢迎。
我的HTML:
<div class="name"><span>{{ field.name }}</span>
Run Code Online (Sandbox Code Playgroud)
我的CSS:
span {
padding: 0 10px;
font-size: 16px;
font-weight: 100;
line-height: 32px;
text-overflow: ellipsis;
overflow: hidden;
display: block;
white-space: nowrap;
}
Run Code Online (Sandbox Code Playgroud)
我个人知道的唯一选择是使用CSS:
body{
background-color: lightgrey;
}
.blue-btn{
position:absolute;
left:35%;
top:40%;
}
.blue-btn a{
color: white;
text-decoration:none;
margin-top: 0em;
text-align: center;
display:inline-block; /* important */
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.blue-btn, .first-link{
-webkit-transition: 3.3s;
-moz-transition: 3.3s;
transition: 3.3s;
-webkit-transition-timing-function: linear;
-moz-transition-timing-function: linear;
transition-timing-function: linear;
}
.blue-btn{
height: 64px;
font: normal normal 700 1em/4em Arial,sans-serif;
overflow: hidden;
width: 200px;
background-color: #3b5998;
}
.blue-btn:hover{
background-color: #003D99;
}
.blue-btn a:hover{
text-decoration: none;
}
.first-link{
margin-left: 0em;
}
.blue-btn:hover .first-link{
margin-left: -300px;
}Run Code Online (Sandbox Code Playgroud)
<html>
<body>
<div class="blue-btn">
<a class="first-link" href="">
This is a very long text, it will take a long time to reach the end
</a>
</div>
</body>
</html> Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
884 次 |
| 最近记录: |