- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
单击箭头后,是否可以使用纯 css 让控件覆盖 div 从底部向上滑动?我的最大高度为 119px;所以叠加层就停在数字下方。我添加了一个过渡和一个 .close 属性,但我似乎无法将其切换到箭头 div。任何人都可以提出建议吗?谢谢。
html, body {
height: 100%;
width: 100%; margin: 0; padding: 0; background: pink; /* fallback for old browsers */
background-color:black;}
.music-container {
width:555px;
height:400px;
background-color:white;
border: 1px solid white;
border-radius:5px;
box-shadow: 0px 15px 54px -12px rgba(94,97,120,1);
position: absolute;
top:0;
bottom: 0;
left: 0;
right: 0;
margin: auto;}
.playing-now {
width:180px;
height:175px;
border: 1px solid transparent;
border-radius:5px;
background-size:cover;
position: absolute;
top:0;
bottom: 130px;
left: 0;
right: 0;
margin: auto;}
.playing-now:hover {
transform:scale(1.01);
cursor:pointer;}
.current-time {
position: absolute;
top:120px;
bottom: 0;
left: 0;
right: 0;
margin: auto;}
.music-bar {
padding: 0 3rem;}
progress {
border: 0;
color: #ED5483;
height: 5px;
width: 45%;
-webkit-appearance: none;}
progress::-webkit-progress-value {
background: #7f7f7f;
border-radius: 10px;}
progress::-webkit-progress-bar {
height: 2.7px;
background: #d8d8d8;
border-radius: 10px;}
.progress-dot {
width:4.5px;
height:4.5px;
border: 1px solid #7f7f7f;
background-color:#7f7f7f;
border-radius:50%;
position: absolute;
top:0;
bottom: -117.5px;
left: 0;
right: 165px;
margin: auto;}
.playing-bar:hover {
cursor:pointer;}
.time {
margin-top:265px;
font-family:Helvetica, sans-serif;
font-size:13px;
color:#7f7f7f;}
.time-left {
float:left; margin-left:138px;}
.time-right {
float:right; margin-right:138px;}
.song-name {
position: absolute;
text-align:center;
top:305px;
bottom: 0;
left: 0;
right: 0;
margin: auto;
font-weight:bold;
font-family:Helvetica, sans-serif;}
.artist {
position: absolute;
text-align:center;
top:330px;
bottom: 0;
left: 0;
color:red;
right: 0;
margin: auto;
font-family:Helvetica, sans-serif;}
.arrow {
transform: scale(0.9);
position: absolute;
top: 375px;
bottom: 0;
left: 0;
width:55px;
right: 0;
margin: auto;}
.arrow:hover {
cursor:pointer;
transform: scale(1);
left:2px;}
.left-side-arrow {
transform: rotate(-19deg);
width:15px;
height:3px;
background-color:#d8d8d8;
border:2px;
border-radius:7px;
position: absolute;
top:0;
bottom: 0;
left: 0px;
right: 12px;
margin: auto;}
.right-side-arrow {
transform: rotate(-340deg);
width:15px;
height:3px;
background-color:#d8d8d8;
border:2px;
border-radius:7px;
position: absolute;
top:0.5px;
bottom: 0;
left: 13.5px;
right: 0;
margin: auto;}
.control-overlay {
width:550px;
max-height:119px;
background-color:rgba(0,255,255,0.5);
overflow-y: hidden;
transition-property: all;
transition-duration: .5s;
transition-timing-function: cubic-bezier(0, 1, 0.5, 1);
border: 1px solid transparent;
border-radius:5px;
position:absolute;
bottom: 0;
left: 0;
right: 0;
margin: auto;}
.control-overlay.closed {
max-height: 0;}
<div class="music-container">
<div class="playing-now"></div>
<div class="playing-time">
<div class="time">
<span class="time-left">0:24</span>
<span class="time-right">-2:19</span>
</div>
</div>
<div class="arrow">
<div class="left-side-arrow"></div>
<div class="right-side-arrow"></div>
</div>
<div class="control-overlay">
<p>controls here</p>
<br/>
<p>controls here</p>
</div>
</div>
最佳答案
在代码笔上:https://codepen.io/stevensonmt/pen/MGVqEW
HTML:
<div class="music-container">
<div class="playing-now"></div>
<div class="playing-time">
<div class="time">
<span class="time-left">0:24</span>
<span class="time-right">-2:19</span>
</div>
</div>
<input type="checkbox" id="toggle_controls" />
<div class="control-overlay">
<p>controls here</p>
<br/>
<p>controls here</p>
</div>
<label for="toggle_controls" onclick>
<div class="arrow">
<div class="left-side-arrow"></div>
<div class="right-side-arrow"></div>
</div>
</label>
</div>
CSS:
html, body {
height: 100%;
width: 100%; margin: 0; padding: 0; background: pink; /* fallback for old browsers */
background-color:black;}
.music-container {
width:555px;
height:400px;
background-color:white;
border: 1px solid white;
border-radius:5px;
box-shadow: 0px 15px 54px -12px rgba(94,97,120,1);
position: absolute;
top:0;
bottom: 0;
left: 0;
right: 0;
margin: auto;}
.playing-now {
width:180px;
height:175px;
border: 1px solid transparent;
border-radius:5px;
background-size:cover;
position: absolute;
top:0;
bottom: 130px;
left: 0;
right: 0;
margin: auto;}
.playing-now:hover {
transform:scale(1.01);
cursor:pointer;}
.current-time {
position: absolute;
top:120px;
bottom: 0;
left: 0;
right: 0;
margin: auto;}
.music-bar {
padding: 0 3rem;}
progress {
border: 0;
color: #ED5483;
height: 5px;
width: 45%;
-webkit-appearance: none;}
progress::-webkit-progress-value {
background: #7f7f7f;
border-radius: 10px;}
progress::-webkit-progress-bar {
height: 2.7px;
background: #d8d8d8;
border-radius: 10px;}
.progress-dot {
width:4.5px;
height:4.5px;
border: 1px solid #7f7f7f;
background-color:#7f7f7f;
border-radius:50%;
position: absolute;
top:0;
bottom: -117.5px;
left: 0;
right: 165px;
margin: auto;}
.playing-bar:hover {
cursor:pointer;}
.time {
margin-top:265px;
font-family:Helvetica, sans-serif;
font-size:13px;
color:#7f7f7f;}
.time-left {
float:left; margin-left:138px;}
.time-right {
float:right; margin-right:138px;}
.song-name {
position: absolute;
text-align:center;
top:305px;
bottom: 0;
left: 0;
right: 0;
margin: auto;
font-weight:bold;
font-family:Helvetica, sans-serif;}
.artist {
position: absolute;
text-align:center;
top:330px;
bottom: 0;
left: 0;
color:red;
right: 0;
margin: auto;
font-family:Helvetica, sans-serif;}
.arrow {
transform: scale(0.9);
position: absolute;
top: 375px;
bottom: 0;
left: 0;
width:55px;
right: 0;
margin: auto;}
.arrow:hover {
cursor:pointer;
transform: scale(1);
left:2px;}
.left-side-arrow {
transform: rotate(-19deg);
width:15px;
height:3px;
background-color:#d8d8d8;
border:2px;
border-radius:7px;
position: absolute;
top:0;
bottom: 0;
left: 0px;
right: 12px;
margin: auto;}
.right-side-arrow {
transform: rotate(-340deg);
width:15px;
height:3px;
background-color:#d8d8d8;
border:2px;
border-radius:7px;
position: absolute;
top:0.5px;
bottom: 0;
left: 13.5px;
right: 0;
margin: auto;}
.control-overlay {
width:550px;
max-height:119px;
background-color:rgba(0,255,255,0.5);
overflow-y: hidden;
transition-property: all;
transition-duration: .5s;
transition-timing-function: cubic-bezier(0, 1, 0.5, 1);
border: 1px solid transparent;
border-radius:5px;
position:absolute;
bottom: 0;
left: 0;
right: 0;
margin: auto;}
.control-overlay.closed {
max-height: 0;}
input[type="checkbox"]{
display: none;
}
/* checked */
input[type=checkbox]:checked ~ .control-overlay {
background: hsla(120, 80%, 50%, .8);
max-height: 0;
}
input[type=checkbox]:checked ~ label {
background: hsla(220, 80%, 50%, .8);
}
关于html - div用纯css向上滑动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50280269/
如果我有如下列, 1 2 2 1 3 4 5 我如何找到从已知值向上的特定数字的第一次出现,比如 4。我知道 4 在列中的位置,我希望第一次出现 1 的行号从 4 向上(行号 4在这种情况下)。 我的
我这里有一个 fiddle http://jsfiddle.net/BB3JK/47/我改编自上一个问题( How can I move selected option in multiselect
大家好,我的应用程序遇到问题。我的复选框中的复选框,一旦我选中该复选框并向下/向上滚动,该复选框就消失了,我不知道这是怎么发生的。谁能帮我这个?谢谢您的帮助 :)这是我的代码: public clas
我想使用 jQuery scrollTo 函数或其他一些类似的函数来实现以下功能,以达到相同的结果。 我的页面上基本上会有一个 DIV 部分,其中包含大约 10 个类别 URL 链接。 例如: div
我有这个标记 Sample 1 Sample 2 Sample 3 Sample 4
我得到了一个包含项目的列表。他们都有一个“排序”列。排序列是int类型,并且是唯一的。 场景: sort 1; sort 2; sort 3; 如果用户在列表中向上移动一个项目(例如排序 3)(例如到
在我的网页上,我在一个可滚动的 DIV 中放置了一个表格。 当我向下滚动时,我想突出显示表格中最可见的中间行。 我该怎么做? 我发现以下脚本接近我的期望 --> www.rgagnon.com/jsd
我已经训练了完全相同的模型(使用完全相同的训练数据集)两次,但结果非常不同,而且我对它们的损失曲线的行为感到困惑。 第一个实验的损失曲线(红色曲线)在第一个时期结束时突然上升,然后缓慢稳定下降。 但是
我希望主导航的子菜单在鼠标悬停时向下滑动并在鼠标移开时向上滑动。 以下是我正在处理的页面:http://jaspreetkaur.com/marg-moll/ 以下是我尝试创建效果的 jQuery 代
我有一个 UIPageViewController,其中每个 VC 的中心都有一个数字。 我希望当我从一个 View 滑动到另一个 View 时,数字将从 0 开始并向上计数,直到达到正确的数字(或者
我一直在谷歌搜索,但找不到正确的脚本。也许有人可以指出我正确的方向? 我需要显示用户自访问某个页面以来在网站上处于事件状态的时间。我正忙于测试站点,例如用户有 1 小时来完成测试,因此我需要显示用户忙
向上/向下箭头滚动在 jquery scrollify 插件中不起作用。我想使用页面向上/向下按钮和向上/向下箭头按钮单击进行滚动。页面向上/向下箭头工作正常,正如我所期望的。向上/向下按钮单击不随着
我想在按下左右箭头时使用数组创建一个上下计数动画。 我有 3 个数组,每个箭头将链接到一个 ID。 var KEY = { LEFT: 37, RIGHT: 39 } $(function(
我对那个 JS 有点问题.. - 有一个 divs 并且这是在随机变化的行中自动变化的... 我需要将向上移动的 div 的颜色更改为绿色.. div 正在向下移动以更改为红色.. 我尝试这样做,但我
我希望能够使用我的键盘键在 ul 列表中滚动。经过几次尝试后,我成功了。 不幸的是,我遇到了一个很长的列表的问题。我希望能够通过提供 css 规则 overflow:auto; 来滚动浏览它们; 键盘
关闭。这个问题需要更多focused .它目前不接受答案。 想改进这个问题吗? 更新问题,使其只关注一个问题 editing this post . 关闭 7 年前。 Improve this q
在我的应用程序中,我允许用户通过使用 ProcessCmdKey 按住右箭头键来滚动电影。现在我想让用户能够在需要时提高滚动速度。理想情况下,用户应该能够按住右箭头键,然后当他决定提高速度时,他应该在
我已经在 listview 上设置了 smoothScrollToPosition 并且效果很好!但是...我宁愿将位置放在 listview 的顶部,而不是仅仅放在屏幕上(如果需要向下滚动,则主要放
我想构建一个脚本来向上/向下滚动到页面的部分标记。我的源代码如下所示: HTML: UP DOWN First Second Third Fourth CSS: section{
我正在使用 Google 搜索结果实现创建一个自定义 ComboBox 控件,但我在使用箭头键时遇到了一些问题。 问题详情 请观看此视频,因为我演示了向上和向下箭头键的问题,并查看输出面板。 http
我是一名优秀的程序员,十分优秀!