- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
当我将鼠标悬停在菜单上时,我正试图将其转到放置子菜单的位置,但它不起作用。我将下拉菜单的高度设置为 0px,当我悬停时我希望它为 650px,这样看起来它正在向下过渡。我需要帮助。
<div class="dropdownform">
<div class="firstdropdown">
<div class="firstblock">Background</div>
<div class="firstblock">Goals</div>
<div class="firstblock">Achievments</div>
</div>
<div class="seconddropdown">
<div class="secondblock">Future</div>
<div class="secondblock">College</div>
<div class="secondblock">Hot 50 Flyer</div>
</div>
<div class="thirddropdown">
<div class="thirdblock">Letter To Freshmen</div>
<div class="thirdblock">Letter of Recommendation</div>
<div class="thirdblock">Scholarship Essay</div>
</div>
</div>
.dropdownform {
display: flex;
flex-direction: row;
position: relative;
left: 5px;
justify-content: space-between;
margin-right: 712px;
bottom: 35px;
}
.firstdropdown {
position: relative;
width: 250px;
height: 0px;
background-color: black;
right: 2.5px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
justify-content: space-around;
border-bottom-right-radius: 35px;
border-bottom-left-radius: 35px;
border-top-right-radius: 12px;
border-top-left-radius: 12px;
overflow: hidden;
}
.seconddropdown {
position: relative;
width: 250px;
height: 0px;
background-color: black;
right: .3px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
justify-content: space-around;
border-bottom-right-radius: 35px;
border-bottom-left-radius: 35px;
border-top-right-radius: 12px;
border-top-left-radius: 12px;
overflow: hidden;
}
.thirddropdown {
position: relative;
width: 250px;
height: 0px;
background-color: black;
left: 1.8px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
justify-content: space-around;
border-bottom-right-radius: 35px;
border-bottom-left-radius: 35px;
border-top-right-radius: 12px;
border-top-left-radius: 12px;
overflow: hidden;
}
.firstblock {
position: relative;
width: 200px;
height: 50px;
background-color: white;
border-radius: 35px;
display: flex;
justify-content: center;
align-items: center;
}
.secondblock {
position: relative;
width: 200px;
height: 50px;
background-color: white;
border-radius: 35px;
display: flex;
justify-content: center;
align-items: center;
}
.thirdblock {
position: relative;
width: 200px;
height: 50px;
background-color: white;
border-radius: 35px;
display: flex;
justify-content: center;
align-items: center;
}
.first:hover + .firstdropdown {
height: 650px;
transition: .5s ease-in-out;
}
这是一张引用图片:image
我知道这可能是重复的,但我没有找到适合我情况的内容。
最佳答案
既然你说你不知道如何使用 jquery,我已经将我的解决方案更改为 css,这是代码:
.mainbackground {
position: absolute;
width: 100%;
height: 100%;
background-color: #1CADF8;
left: 0;
top: 0;
}
.first {
position: relative;
width: 250px;
height: 50px;
background-color: #321896;
border-radius: 35px;
display: flex;
justify-content: center;
align-items: center;
color: white;
}
.second {
position: relative;
width: 250px;
height: 50px;
background-color: #321896;
border-radius: 35px;
display: flex;
justify-content: center;
align-items: center;
color: white;
}
.third {
position: relative;
width: 250px;
height: 50px;
background-color: #321896;
border-radius: 35px;
display: flex;
justify-content: center;
align-items: center;
color: white;
}
.mainform {
position: relative;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
margin: 5px 2.5px 0px 2.5px;
}
.form {
position: relative;
width: 250px;
height: 50px;
background-color: white;
border-radius: 35px;
}
.form {
display: flex;
}
.search {
position: relative;
background: transparent;
outline: none;
border: none;
top: 1px;
left: 10px;
}
.searchbutton {
display: flex;
position: relative;
width: 48px;
height: 48px;
border-radius: 35px;
background: #321896;
border: none;
outline: none;
left: 43px;
top: 1px;
justify-content: center;
align-items: center;
}
.search {
font-size: 25px;
width: 158px;
}
.loading {
position: relative;
border: 2px solid white;
width: 25px;
height: 25px;
border-radius: 35px;
border-style: dotted;
animation: test 3s infinite;
display: flex;
justify-content: center;
}
@keyframes test {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.pi {
color: white;
animation: test2 3s infinite;
padding-top: 1.5px;
}
@keyframes test2 {
0% {
transform: rotate(0deg);
opacity: 0;
}
50% {
opacity: 1;
}
100% {
transform: rotate(-360deg);
opacity: 0;
}
}
.logout {
position: relative;
width: 250px;
height: 50px;
background-color: #E70D0D;
border-radius: 35px;
}
.navform {
position: relative;
display: flex;
flex-direction: row;
justify-content: space-between;
flex: 2;
}
.sliderform {
display: flex;
flex-direction: row;
justify-content: space-between;
margin-right: 150px;
flex: 3;
}
.dropdownform {
display: flex;
flex-direction: row;
position: relative;
left: 5px;
justify-content: space-between;
margin-right: 712px;
bottom: 35px;
}
.firstdropdown {
position: absolute;/* < new code */
top: 50px;/* < new code */
width: 250px;
height: 0px;
background-color: black;
right: 2.5px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
justify-content: space-around;
border-bottom-right-radius: 35px;
border-bottom-left-radius: 35px;
border-top-right-radius: 12px;
border-top-left-radius: 12px;
overflow: hidden;
}
.seconddropdown {
position: absolute;/* < new code */
top: 50px;/* < new code */
width: 250px;
height: 0px;
background-color: black;
right: .3px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
justify-content: space-around;
border-bottom-right-radius: 35px;
border-bottom-left-radius: 35px;
border-top-right-radius: 12px;
border-top-left-radius: 12px;
overflow: hidden;
}
.thirddropdown {
position: absolute;/* < new code */
top: 50px;/* < new code */
width: 250px;
height: 0px;
background-color: black;
left: 1.8px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
justify-content: space-around;
border-bottom-right-radius: 35px;
border-bottom-left-radius: 35px;
border-top-right-radius: 12px;
border-top-left-radius: 12px;
overflow: hidden;
}
.firstblock {
position: relative;
width: 200px;
height: 50px;
background-color: white;
border-radius: 35px;
display: flex;
justify-content: center;
align-items: center;
color: #000;/* < new code */
}
.secondblock {
position: relative;
width: 200px;
height: 50px;
background-color: white;
border-radius: 35px;
display: flex;
justify-content: center;
align-items: center;
color: #000;/* < new code */
}
.thirdblock {
position: relative;
width: 200px;
height: 50px;
background-color: white;
border-radius: 35px;
display: flex;
justify-content: center;
align-items: center;
color: #000;/* < new code */
}
.first:hover .firstdropdown {/* < new code */
height: 650px;
transition: .5s ease-in-out;
}
.second:hover .seconddropdown {/* < new code */
height: 650px;
transition: .5s ease-in-out;
}
.third:hover .thirddropdown {/* < new code */
height: 650px;
transition: .5s ease-in-out;
}
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="/css/main.css">
</head>
<body>
<section class="mainbackground">
<div class="mainform">
<div class="sliderform">
<div class="first">
<h3>
First
</h3>
<div class="firstdropdown">
<div class="firstblock">Background</div>
<div class="firstblock">Goals</div>
<div class="firstblock">Achievments</div>
</div>
</div>
<div class="second">
<h3>Second</h3>
<div class="seconddropdown">
<div class="secondblock">Future</div>
<div class="secondblock">College</div>
<div class="secondblock">Hot 50 Flyer</div>
</div>
</div>
<div class="third">
<h3>Third</h3>
<div class="thirddropdown">
<div class="thirdblock">Letter To Freshmen</div>
<div class="thirdblock">Letter of Recommendation</div>
<div class="thirdblock">Scholarship Essay</div>
</div>
</div>
</div>
<div class="navform">
<div class="form">
<input type="text" placeholder="#CODE" class="search">
<a href="main.html" class="searchbutton">
<div class="loading">
<div class="pi">π</div>
</div>
</a>
</div>
<a href="" class="logout"></a>
</div>
</div>
</section>
</body>
</html>
关于html - 当悬停在菜单上时下拉子菜单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53810842/
我正在学习和使用 jQuery,并且想要显示某些元素的删除图标。 我有一个外部主 div,其中包含许多元素的包装器。在元素包装器内部,我想当用户将鼠标悬停在元素包装器上时显示删除图标,并在用户移出元素
已关闭。此问题需要 debugging details 。目前不接受答案。 编辑问题以包含 desired behavior, a specific problem or error, and the
我从 Qt 开始,每当有人将鼠标悬停在 QPushButton 上时,我想将 QPushButton 设置为不同的图标。到目前为止,这是我的代码: #include QPushButton *but
我从 Qt 开始,我想在有人将鼠标悬停在 QPushButton 上时将其设置为不同的图标。到目前为止,这是我的代码: #include QPushButton *button = new QPus
我有以下代码... jQuery(function($) { var timer; $('.action-viewer').hide(); $('.task').on('mouseover
我有一张照片,当用户将鼠标悬停在它上面时,我会在照片顶部显示(使用绝对定位)2 个箭头,一个用于进入上一张照片,一个用于进入下一张照片。这是到目前为止的代码... $('a.large_product
$('li > a').hover( function(){ $(this).animate({ backgroundColor: '#2a639a', color: '#fff'
我有一个悬停事件附加到几个链接,当您点击它时,会出现一个框。 有没有一种方法可以让悬停事件仅在鼠标悬停在链接上超过 500 毫秒时触发?因此,目前只要鼠标移到链接上,就会出现该框,但我希望只有当鼠标悬
我正在创建包含各种样式控件的演示应用程序。它允许我快速预览更改。 我的问题是下面的代码不起作用: Pressed button 它表示 IsPressed 的 setter 受到保护。我明白了,但我需
我正在尝试使用 js 并创建带有一些“信息文本”的“描述框” HTML google JS function info() {} 我不知道是哪个代码用一些文本创建了所谓的“描
我有一个 Accordion 风格的菜单,在悬停状态下工作正常,但我想改为点击... $(document).ready(function(){ $('#nav > li').hover(
我正在使用 Chartjs v.1.0.2 并尝试将点设置为仅在悬停在当前点上时出现。同样的问题是当我使用悬停或鼠标悬停时。可以使用 getPointsAtEvent(e); 找到当前点,但它仅在我将
我使用foreach 语句访问IEnumerable 的所有元素并将其呈现在详细信息页面中。我想让每个元素的悬停属性只影响一个元素。所以我使用 jQuery 单独影响每个元素 但是当我运行代码并将鼠标
首先提前感谢您的帮助。 案例:我在一行中有多个 div。这些 div 位于一个框中,我可以在此框中水平滚动以查看其他 div。我制作了两个按钮(L 表示左侧,R 表示右侧),以便在悬停或单击这些按钮时
我正在创建一个应用外观页面。 我希望在鼠标悬停时打开底部菜单上的其中一个按钮。 这感觉像是一项简单的任务,但我所做的一切似乎都不起作用。我错过了什么,我做了很多研究,但似乎找不到解决方案。 我尝试使用
我遇到的问题是,当您将鼠标悬停在按钮上时,只有按钮的某些部分会触发悬停/可点击状态,而不是所有实际 block 。有什么想法吗? 这是使用它的站点:http://www.revival.tv/turn
我有一位客户想要在他们的网站上实现特定功能,但我有点困惑如何做到这一点。 基本上,如果你查看他们的 existing site您可以看到 4 个圆形按钮。 他们想要的是,当有人将鼠标悬停(或单击,如果
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 关闭 9 年前。 关于您编写的代码问题的问题必须在问题本身中描述具体问题 — 并且包括有效代码 以
我目前正在编写我的第一个响应式网站(总的来说我是一个初学者)并且我遇到了很多障碍。其中之一是我的菜单有问题。我会尽量具体。我有一个用于桌面的水平菜单和一个用于平板电脑/手机的垂直菜单。我不知道如何解决
我正在为网站创建菜单。我正试图在链接上实现悬停 和点击 效果。我希望列表元素 a 上的悬停事件触发彩色动画并添加“事件”类。如果触发了点击和悬停事件,我想为该元素分配相同的类。问题是,一旦元素未悬停并
我是一名优秀的程序员,十分优秀!