Jquery 鼠标悬停时如何能使li出现一些内容 同侧眼睑 同侧眼睑
在主css中,不显示.hidden_区域。我使用overflow:hidden 但我想当鼠标悬停时,使隐藏区域可见并覆盖所有内容,位置:绝对代码> 这张图片解释了我想要什么 我尝试添加位置:相对;到Jquery 鼠标悬停时如何能使li出现一些内容 同侧眼睑 同侧眼睑,jquery,html,css,hover,html-lists,Jquery,Html,Css,Hover,Html Lists,在主css中,不显示.hidden_区域。我使用overflow:hidden 但我想当鼠标悬停时,使隐藏区域可见并覆盖所有内容,位置:绝对 这张图片解释了我想要什么 我尝试添加位置:相对;到并添加位置:绝对到.hidden_区域并更改的顶部值。hidden_区域,但它不起作用:( 例如: 对不起,英语不好:)这是我做的东西。不确切。因为我不知道你在CSS中做什么,但这应该会有帮助,让你知道如何做 这是小提琴: 你有一个UL和3个LI在里面对吗 当用户悬停时,您需要这样做 使用jQuer
并添加位置:绝对
到.hidden_区域
并更改的顶部值。hidden_区域
,但它不起作用:(
例如:
对不起,英语不好:)这是我做的东西。不确切。因为我不知道你在CSS中做什么,但这应该会有帮助,让你知道如何做 这是小提琴: 你有一个UL和3个LI在里面对吗 当用户悬停时,您需要这样做 使用jQuery UI选项卡(): HTML:
使用
:悬停
伪类更改隐藏区域
的显示
属性。在您的隐藏区类上设置位置:绝对,并使用顶部
属性对其进行定位
.ui-tabs {
position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
padding: .2em;
}
.ui-tabs .ui-tabs-nav {
margin: 0;
padding: .2em .2em 0;
}
.ui-tabs .ui-tabs-nav li {
list-style: none;
float: left;
position: relative;
top: 0;
margin: 1px .2em 0 0;
border-bottom-width: 0;
padding: 0;
white-space: nowrap;
}
.ui-tabs .ui-tabs-nav li a {
float: left;
padding: .5em 1em;
text-decoration: none;
}
.ui-tabs .ui-tabs-nav li.ui-tabs-active {
margin-bottom: -1px;
padding-bottom: 1px;
}
.ui-tabs .ui-tabs-nav li.ui-tabs-active a,
.ui-tabs .ui-tabs-nav li.ui-state-disabled a,
.ui-tabs .ui-tabs-nav li.ui-tabs-loading a {
cursor: text;
}
.ui-tabs .ui-tabs-nav li a, /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a {
cursor: pointer;
}
.ui-tabs .ui-tabs-panel {
display: block;
border-width: 0;
padding: 1em 1.4em;
background: none;
}
#content {
clear: both;
margin-top: 15px;
}
。隐藏区域{
位置:绝对位置;
top:200px;//你的
显示:无;
}
李:悬停,隐藏区{
显示:块;
}
编辑:这里使用的是您的JSFIDLE:
移除溢出:隐藏
,它隐藏了你的。隐藏区域
divs。相反,用display:none隐藏.hidden_区域
,并用display:块显示它(使用*li:hover.hidden_区域*)如果我理解你的意思,你需要一个简单的悬停,所以…试试这个。这里有一个
如果你能把它放到一个文件夹中,那就太好了,因为如果没有看到你的CSS等,几乎不可能重新创建你的情况。我们需要看到你的CSSThank you:)但我想要。内容上的隐藏区域,如此谢谢:),但这不是我要找的,当鼠标悬停在
上时,可以看到我正在寻找的这张图片。内容上方会出现一个区域,谢谢:)
ul li {
height: 100px;
width:100px;
background: red;
margin: 10px;
padding: 5px;
list-style: none outside none;
float:left;
}
div.hidden_area{
display:none;
}
ul li:hover > .hidden_area{
display:block;
margin:80px 0 0 0;
width:105px;
height: 200px;
background: black;
color:blue;
overflow:auto;
z-index: 100;
}
.clear{
clear:both;
width:500px;
height: 200px;
border: 1px solid #000000;
}
<h2 class="demoHeaders">Tabs</h2>
<div id="tabs">
<ul>
<li><a href="#tabs-1">First</a></li>
<li><a href="#tabs-2">Second</a></li>
<li><a href="#tabs-3">Third</a></li>
</ul>
<div id="content">
<div id="tabs-1">content 1.</div>
<div id="tabs-2">content 2.</div>
<div id="tabs-3">content 3.</div>
</div>
</div>
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="JQUERY_UI"></script> //Find it at http://jqueryui.com/download/
<script>
$(function() {
$( "#tabs" ).tabs();
// Hover states on the static widgets
$( "#dialog-link, #icons li" ).hover(
function() {
$( this ).addClass( "ui-state-hover" );
},
function() {
$( this ).removeClass( "ui-state-hover" );
}
);
});
</script>
.ui-tabs {
position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
padding: .2em;
}
.ui-tabs .ui-tabs-nav {
margin: 0;
padding: .2em .2em 0;
}
.ui-tabs .ui-tabs-nav li {
list-style: none;
float: left;
position: relative;
top: 0;
margin: 1px .2em 0 0;
border-bottom-width: 0;
padding: 0;
white-space: nowrap;
}
.ui-tabs .ui-tabs-nav li a {
float: left;
padding: .5em 1em;
text-decoration: none;
}
.ui-tabs .ui-tabs-nav li.ui-tabs-active {
margin-bottom: -1px;
padding-bottom: 1px;
}
.ui-tabs .ui-tabs-nav li.ui-tabs-active a,
.ui-tabs .ui-tabs-nav li.ui-state-disabled a,
.ui-tabs .ui-tabs-nav li.ui-tabs-loading a {
cursor: text;
}
.ui-tabs .ui-tabs-nav li a, /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a {
cursor: pointer;
}
.ui-tabs .ui-tabs-panel {
display: block;
border-width: 0;
padding: 1em 1.4em;
background: none;
}
#content {
clear: both;
margin-top: 15px;
}
.hidden_area{
position:absolute;
top:200px; // the height of your <li>
display:none;
}
li:hover .hidden_area{
display:block;
}
#div_name {
width: 630px;
height: 200px;
margin: 20px auto;
border: 1px solid #999;
}
ul li {
background: #252525;
list-style: none;
float: left;
width: 170px;
height: 170px;
margin: 10px 15px 10px 15px;
padding: 5px;
font-family: Verdana;
font-size: 16px;
letter-spacing: 1px;
color: #fff;
}
.hidden_area {
background: #892b2b;
position: absolute;
display: none;
width: 170px;
height: 130px;
margin-top: 157px;
margin-left: -5px;
padding: 5px;
text-align: center;
}
ul li:hover .hidden_area {
display: block;
}