jquery 鼠标移过层的显示隐藏
2009-12-15 14:00
316 查看
.nav1, .nav1 ul
{
list-style: none;
margin: 0;
padding: 0;
width: 450px;
}
.nav1
{
margin-top: 0px;
}
.nav1
{
font-family: Arial, Helvetica, sans-serif;
z-index: 100;
position: relative; /**/
}
.nav1 li span.relative
{
position: relative;
}
.nav1 li
{
float: left;
padding: 0 5px;
position: relative; /**/
width: auto;
}
.nav1 li a, .nav1 li a:link, .nav1 li a:active, .nav1 li a:visited
{
font: bold 1.22em/25px Arial, Helvetica, sans-serif;
background: #565656;
color: #959595;
display: block;
float: left;
text-transform: lowercase;
text-decoration: none;
}
.nav1 li a:hover
{
background: #ccc;
color: #fff;
}
#nav-one li:hover a, #nav-one li.sfHover a
{
background: #ccc;
color: #000;
}
#nav-one li:hover ul a, #nav-one li.sfHover ul a
{
background: #565656;
color: #959595;
}
#nav-one li:hover ul a:hover, #nav-one li.sfHover ul a:hover
{
background: #ccc;
color: #000;
}
.nav1 li ul li
{
float: left;
text-align: left;
width: 280px;
height: 20px;
cursor: pointer;
display: block;
overflow: hidden;
white-space: nowrap;
line-height: 1.5em;
}
.nav1 li ul li a
{
display: block;
float: left;
text-align: left;
width: 300px;
color: #186aad;
}
.nav1 li:hover ul, .nav1 li.sfHover ul
{
top: 25px; /*left:261px;*/
left: -209px;
}
.nav1 ul li
{
border: 0;
}
.nav1 ul a
{
border: 1px solid #000;
border-bottom: 0;
width: 80px;
white-space: nowrap;
}
.nav1 ul a:hover
{
background: #ccc;
color: #186aad;
float: left;
}
#spTypeName
{
cursor: pointer;
}
<ul id="nav-one" class="nav1">
<li id="liTypeName" style="display: none;"><span style="width: 75px; height: 24px;
border: 1px solid #bdbf4a; background: #fbfbdb; display: block; overflow: hidden;
white-space: nowrap;" id="spTypeName"></span>
<ul style="color: #186aad;" id="divAddressType">
<%
for (int i = 0; i < listroot.ChildNodes.Count; i++)
{
string typeName = listroot.ChildNodes[i]["TypeName"].InnerText;
string areaName = listroot.ChildNodes[i]["AreaName"].InnerText;
string address = listroot.ChildNodes[i]["address"].InnerText;
string addressInfo = "";
if (listroot.ChildNodes[i]["TypeName"].InnerText != "")
{
addressInfo = "(" + typeName.Trim() + ")/t/t" + areaName.Trim() + "/t/t" + address.Trim();
Response.Write("<li id='spAddressType_" + listroot.ChildNodes[i]["ID"].InnerText + "' onclick='getUserAddressSingle(this.id," + listroot.ChildNodes[i]["userID"].InnerText + ")' title='(" + typeName.Trim() + ")/t/t" + areaName.Trim() + "/t/t" + address.Trim() + "'>" + addressInfo.Trim() + "</li>");
}
else
{
addressInfo = "(" + areaName.Trim() + ")/t/t" + areaName.Trim() + "/t/t" + address.Trim();
Response.Write("<li id='spAddressType_" + listroot.ChildNodes[i]["ID"].InnerText + "' onclick='getUserAddressSingle(this.id," + listroot.ChildNodes[i]["userID"].InnerText + ")' title='(" + areaName.Trim() + ")/t/t" + areaName.Trim() + "/t/t" + address.Trim() + "'>" + addressInfo.Trim() + "</li>");
}
}
%></ul>
</li>
<li><span id="spAreaName" style="overflow: hidden; height: 24px; width: 100px;"></span>
</li>
<span id="lnkCheckOtherArea" onclick="CheckOtherAddress()" style="display: none;
margin-right: -3px; color: Red; cursor: pointer;">[切换]</span>
<%--<li id="Address"></li>--%>
</ul>
$(document).ready(function(){
$("#nav-one li").hover(
function(){ $("ul", this).fadeIn("fast"); },
function() { }
);
if (document.all) {
$("#nav-one li").hoverClass ("sfHover");
}
});
$.fn.hoverClass = function(c) {
return this.each(function(){
$(this).hover(
function() { $(this).addClass(c); },
function() { $(this).removeClass(c); }
);
});
};
$(document).ready(function(){
$("#nav-one li").hover(
function(){ $("ul", this).fadeIn("fast"); },
function() { }
);
if (document.all) {
$("#nav-one li").hoverClass ("sfHover");
}
});
$.fn.hoverClass = function(c) {
return this.each(function(){
$(this).hover(
function() { $(this).addClass(c); },
function() { $(this).removeClass(c); }
);
});
};
function GetMyPosition(data)
{
var str="<a>"+$(data).find("ProvinceName").text()+"</a>><a>"+$(data).find("RegionName").text()+"</a>><span class='t'>"+$(data).find("AreaName").text()+"</span>>";
$("#MyPosition").html(str);
}
{
list-style: none;
margin: 0;
padding: 0;
width: 450px;
}
.nav1
{
margin-top: 0px;
}
.nav1
{
font-family: Arial, Helvetica, sans-serif;
z-index: 100;
position: relative; /**/
}
.nav1 li span.relative
{
position: relative;
}
.nav1 li
{
float: left;
padding: 0 5px;
position: relative; /**/
width: auto;
}
.nav1 li a, .nav1 li a:link, .nav1 li a:active, .nav1 li a:visited
{
font: bold 1.22em/25px Arial, Helvetica, sans-serif;
background: #565656;
color: #959595;
display: block;
float: left;
text-transform: lowercase;
text-decoration: none;
}
.nav1 li a:hover
{
background: #ccc;
color: #fff;
}
#nav-one li:hover a, #nav-one li.sfHover a
{
background: #ccc;
color: #000;
}
#nav-one li:hover ul a, #nav-one li.sfHover ul a
{
background: #565656;
color: #959595;
}
#nav-one li:hover ul a:hover, #nav-one li.sfHover ul a:hover
{
background: #ccc;
color: #000;
}
.nav1 li ul li
{
float: left;
text-align: left;
width: 280px;
height: 20px;
cursor: pointer;
display: block;
overflow: hidden;
white-space: nowrap;
line-height: 1.5em;
}
.nav1 li ul li a
{
display: block;
float: left;
text-align: left;
width: 300px;
color: #186aad;
}
.nav1 li:hover ul, .nav1 li.sfHover ul
{
top: 25px; /*left:261px;*/
left: -209px;
}
.nav1 ul li
{
border: 0;
}
.nav1 ul a
{
border: 1px solid #000;
border-bottom: 0;
width: 80px;
white-space: nowrap;
}
.nav1 ul a:hover
{
background: #ccc;
color: #186aad;
float: left;
}
#spTypeName
{
cursor: pointer;
}
<ul id="nav-one" class="nav1">
<li id="liTypeName" style="display: none;"><span style="width: 75px; height: 24px;
border: 1px solid #bdbf4a; background: #fbfbdb; display: block; overflow: hidden;
white-space: nowrap;" id="spTypeName"></span>
<ul style="color: #186aad;" id="divAddressType">
<%
for (int i = 0; i < listroot.ChildNodes.Count; i++)
{
string typeName = listroot.ChildNodes[i]["TypeName"].InnerText;
string areaName = listroot.ChildNodes[i]["AreaName"].InnerText;
string address = listroot.ChildNodes[i]["address"].InnerText;
string addressInfo = "";
if (listroot.ChildNodes[i]["TypeName"].InnerText != "")
{
addressInfo = "(" + typeName.Trim() + ")/t/t" + areaName.Trim() + "/t/t" + address.Trim();
Response.Write("<li id='spAddressType_" + listroot.ChildNodes[i]["ID"].InnerText + "' onclick='getUserAddressSingle(this.id," + listroot.ChildNodes[i]["userID"].InnerText + ")' title='(" + typeName.Trim() + ")/t/t" + areaName.Trim() + "/t/t" + address.Trim() + "'>" + addressInfo.Trim() + "</li>");
}
else
{
addressInfo = "(" + areaName.Trim() + ")/t/t" + areaName.Trim() + "/t/t" + address.Trim();
Response.Write("<li id='spAddressType_" + listroot.ChildNodes[i]["ID"].InnerText + "' onclick='getUserAddressSingle(this.id," + listroot.ChildNodes[i]["userID"].InnerText + ")' title='(" + areaName.Trim() + ")/t/t" + areaName.Trim() + "/t/t" + address.Trim() + "'>" + addressInfo.Trim() + "</li>");
}
}
%></ul>
</li>
<li><span id="spAreaName" style="overflow: hidden; height: 24px; width: 100px;"></span>
</li>
<span id="lnkCheckOtherArea" onclick="CheckOtherAddress()" style="display: none;
margin-right: -3px; color: Red; cursor: pointer;">[切换]</span>
<%--<li id="Address"></li>--%>
</ul>
$(document).ready(function(){
$("#nav-one li").hover(
function(){ $("ul", this).fadeIn("fast"); },
function() { }
);
if (document.all) {
$("#nav-one li").hoverClass ("sfHover");
}
});
$.fn.hoverClass = function(c) {
return this.each(function(){
$(this).hover(
function() { $(this).addClass(c); },
function() { $(this).removeClass(c); }
);
});
};
$(document).ready(function(){
$("#nav-one li").hover(
function(){ $("ul", this).fadeIn("fast"); },
function() { }
);
if (document.all) {
$("#nav-one li").hoverClass ("sfHover");
}
});
$.fn.hoverClass = function(c) {
return this.each(function(){
$(this).hover(
function() { $(this).addClass(c); },
function() { $(this).removeClass(c); }
);
});
};
function GetMyPosition(data)
{
var str="<a>"+$(data).find("ProvinceName").text()+"</a>><a>"+$(data).find("RegionName").text()+"</a>><span class='t'>"+$(data).find("AreaName").text()+"</span>>";
$("#MyPosition").html(str);
}
相关文章推荐
- jquery 实现超出部分隐藏,鼠标移动上显示全部文字
- Jquery将隐藏div按照鼠标位置来显示
- jquery 实现超出部分隐藏,鼠标移动上显示全部文字
- jquery 实现超出部分隐藏,鼠标移动上显示全部文字 .
- jquery 实现超出部分隐藏,鼠标移动上显示全部文字
- 基于JQuery实现鼠标点击文本框显示隐藏提示文本
- jQuery事件-div的显示隐藏及鼠标的移入移出
- jQuery事件-div的显示隐藏及鼠标的移入移出
- jquery让div隐藏,显示,随着鼠标移动
- jquery鼠标滑过显示DIV,鼠标移开隐藏DIV
- [jquery实例] 鼠标悬停显示当前隐藏元素
- jQuery hover事件鼠标滑过图片半透明标题文字滑动显示隐藏
- Jquery 父窗口中移进移出鼠标到Iframe: 移进显示更多内容, 移出隐藏部分内容
- jQuery版感应鼠标显示隐藏的菜单
- jquery自定义滚动条 鼠标移入或滚轮时显示 鼠标离开或悬停超时时隐藏
- jQuery事件-div的显示隐藏及鼠标的移入移出
- jquery悬停,鼠标移上去显示全部内容(包括多余隐藏内容)
- 鼠标放上去显示全部文字,不放上去,显示部分文字jquery效果,包括隐藏部分文字
- jQuery响应鼠标事件并隐藏与显示input默认值
- jQuery实现表单input中提示文字value随鼠标焦点移进移出而显示或隐藏的代码