当用户单击“登录”时,我正在使用 jQuery 向下滑动登录框。单击它时,我希望整个页面向下滑动,包括徽标。到目前为止,页面确实向下滑动,除了徽标。您可以在此处查看页面:
单击“登录”或“注册”时,页面的主体会向下滑动(将底部边距设置为 500 像素以夸大它)。但是,正如您所见,“mi.ni”徽标并没有滑落。
<div id = 'header'>
<a href = '/' title = 'mi.ni' id = 'logo'>mi.ni</a>
</div>
上面是徽标的 HTML,下面是 CSS。
#wrapper
{
width: 1000px;
margin-left: auto;
margin-right: auto;
}
#wrapper #header
{
height: 100px;
width: 260px;
background: url('/styles/images/logo2.png') no-repeat;
margin: 20px auto 0px auto;
}
#wrapper #header #logo
{
height: 100px;
width: 260px;
display: block;
text-indent: -9999px;
}
标头被包装在包装器中。登录框滑下的栏不在包装内。
登录/注册框的 CSS 是:
#topBar #signIn, #signUp
{
width: 250px;
float: right;
color: #FFF;
margin-top: 5px;
font-weight: bold;
display: none;
margin-bottom: 500px;
}
对此问题的任何帮助表示赞赏!
编辑:跨越页面顶部的栏的 HTML。
<div id = 'topBarWrapper'>
<div id = 'topBar'>
<div id = 'mainTop'>
mi.ni is a URL shortening service. Learn more about mi.ni. I am trying my hardest to get the domain http://mi.ni.
</div>
<div id = 'rightTop'>
<span id = 'signInText'>Sign In</span>
|
<span id = 'signUpText'>Sign up</span>
</div>
<div id = 'signIn'>
<form action = '' method = 'POST'>
<table>
<tr>
<td>Username:</td>
<td><input type = 'text' name = 'username' id = 'usernameSignIn' class = 'input' /></td>
</tr>
<tr>
<td>Password:</td>
<td><input type = 'password' name = 'password' id = 'passwordSignIn' class = 'input' /></td>
</tr>
<tr>
<td></td>
<td><div class = 'signInSubmit'></div></td>
</tr>
</table>
</form>
</div>
<div id = 'signUp'>
<form action = '' method = 'POST'>
<table>
<tr>
<td>Username:</td>
<td><input type = 'text' name = 'username' id = 'usernameSignUp' class = 'input' /></td>
</tr>
<tr>
<td>Email:</td>
<td><input type = 'text' name = 'email' id = 'emailSignUp' class = 'input' /></td>
</tr>
<tr>
<td>Password:</td>
<td><input type = 'password' name = 'password' id = 'passwordSignUp' class = 'input' /></td>
</tr>
<tr>
<td></td>
<td><div class = 'signUpSubmit'></div></td>
</tr>
</table>
</form>
</div>
</div>
</div>
栏的 CSS:
#topBarWrapper
{
width: 100%;
height: 25px;
padding-top: 5px;
background: #000;
color: #FFF;
}
#topBar
{
width: 1050px;
margin-left: auto;
margin-right: auto;
}
#topBar #mainTop
{
display: inline;
}
#topBar #rightTop
{
display: inline;
margin-left: 50px;
font-weight: bold;
}
#topBar #rightTop #signInText
{
cursor: pointer;
margin-right: 5px;
}
#topBar #rightTop #signUpText
{
cursor: pointer;
margin-left: 5px;
}
#topBar #signIn, #signUp
{
width: 250px;
float: right;
color: #FFF;
margin-top: 5px;
font-weight: bold;
display: none;
margin-bottom: 500px;
}