gpt4 book ai didi

jquery - 我在哪里合并或添加标题上的下拉菜单脚本。 fiddle

转载 作者:行者123 更新时间:2023-11-28 10:06:20 27 4
gpt4 key购买 nike

我正在尝试合并 2 个代码。我找到了我要找的两个代码。我真的很新@this所以请理解。

这是页眉页脚和背景: http://jsfiddle.net/F6dez/

这是下拉菜单: http://jsfiddle.net/Mrdel/Wxs5n/2/

这是我尝试合并两者的尝试:我试图留下一个链接,但它不会让我留下超过 2 个链接:/

菜单代码如下:

HTML:

<ul id="nav">

<li>
<a href="#">Music</a>
<ul>
<li><a href="#">New Tracks</a></li>
<li><a href="#">Old Tunes</a></li>
<li><a href="#">Downloads</a></li>
<li><a href="#">Upcoming</a></li>
</ul>
</li>


</ul>
</li>
</ul>

还有CSS:

ul { list-style: none; padding: 0; margin: 0;}

/* Style */

a {
color: #000;
display: block;
font-size: 14px;
text-decoration: none;
font-family: 'Open Sans', serif;
}
nav {
width: 100%;
height: 45px;
}
#nav ul li:hover,
#nav > li:hover {
background: #2e98d5;
}
#nav ul > li:hover > a,
#nav > li:hover > a {
color: #fff;
}
#nav > li {
float: left;
position: relative;
}
#nav > li > a {
padding: 13px 30px;
height: 20px;
}



#nav > li:hover ul {
visibility: visible;
-webkit-transition-delay: 0s;
-moz-transition-delay: 0s;
-o-transition-delay: 0s;
transition-delay: 0s;
}
#nav ul {
top: 46px;
width: 170px;
position: absolute;
background-color: #eee;
z-index: 1;
visibility: hidden;
-webkit-transition-property: visibility;
-moz-transition-property: visibility;
-o-transition-property: visibility;
transition-property: visibility;

-webkit-transition-duration: 0s;
-moz-transition-duration: 0s;
-o-transition-duration: .0s;
transition-duration: 0s;

-webkit-transition-delay: .25s;
-moz-transition-delay: .25s;
-o-transition-delay: .25s;
transition-delay: .25s;
}

/* The slide */
#nav li li a {
height: 0px;
padding: 0px 30px;
opacity: 0;
-webkit-transition-property: height, padding, opacity;
-moz-transition-property: height, padding, opacity;
-o-transition-property: height, padding, opacity;
transition-property: height, padding, opacity;

-webkit-transition-duration: .25s, .25s, .08s;
-moz-transition-duration: .25s, .25s, .08s;
-o-transition-duration: .25s, .25s, .08s;
transition-duration: .25s, .25s, .08s;

-webkit-transition-delay: 0s, 0s, .05s;
-moz-transition-delay: 0s, 0s, .05s;
-o-transition-delay: 0s, 0s, .05s;
transition-delay: 0s, 0s, .05s;
}
#nav li:hover li a {
height: 20px;
padding: 13px 30px;
opacity: 1;
}

背景代码如下:

HTML:

<!Doctype html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/style.css"/>
</head>
<body>
<div class="container">
<div class="header">
This is header
</div>
<div class="content">
<div class="gap"></div>
<p>First line...............</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Long content goes here...</p>
<p>Last line................</p>
<div class="gap"></div>
</div>
<div class="footer">
This is footer
</div>
</div>
</body>
</html>

还有CSS:

 html {
height:100%;
max-height:100%;
padding:0;
margin:0;
border:0;
overflow: hidden;
}
body {
height:100%;
max-height:100%;
overflow:hidden;
padding:0;
margin:0;
border:0
font: 12px Verdana, Helvetica, sans-serif;
color: #F3F3F3;
}
.container {
width : 100%;
height: 100%;
max-height:100%;
}
.header {
position:absolute;
margin:0;
top:0;
display:block;
width:100%;
height:80px;
z-index:5;
background-color: #656565;
text-align : center;
right:18px;
line-height: 80px;
font-size:2em;
}
.footer {
position:absolute;
margin:0;
bottom:-1px;
display:block;
width:100%;
z-index:4;
height : 80px;
background-color: #656565;
text-align : center;
right:18px;
line-height: 80px;
font-size:2em;
}
.content {
display:block;
height:100%;
max-height:100%;
overflow:auto;
position:relative;
z-index:3;
background-color: #909090;
text-align : center;
}
.gap {height : 80px;}

最佳答案

我不完全确定我理解你在这里寻找什么,因为它应该像复制菜单代码一样简单:

<ul id="nav">

<li>
<a href="#">Music</a>
<ul>
<li><a href="#">New Tracks</a></li>
<li><a href="#">Old Tunes</a></li>
<li><a href="#">Downloads</a></li>
<li><a href="#">Upcoming</a></li>
</ul>
</li>
</ul>

并将其粘贴到头部容器中: http://jsfiddle.net/LH5TC/

关于jquery - 我在哪里合并或添加标题上的下拉菜单脚本。 fiddle ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24541818/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com