2011-02-15 88 views
0

当您单击登录按钮时,当slideDown事件正在运行时显示一些空间。 什么导致了空白?jQuery slideDown问题

这里的页面 - http://rssreaderbg.net/pubsubbub/example/cssexam/index.php


$("#login").click(function() { 
    $("#loginform").slideDown(); 
    $("#home").attr("class",""); 
    $("#login").attr("class","selected"); 
}); 

#nav { 
    float:left; 
    margin-left:100px; 
    padding-top:17px; 
    list-style-type:none; 
} 

#nav li { 
    display: inline-block; /* ??? ??????? ?? ????? ?? inline*/ 
    padding-right:0px; 
    float:left; 
} 

#nav a { 
    display: inline-block; /* ??? ??????? ?? ????? ?? inline*/ 
    padding-left:9px; 
    float:left; 
    height:52px; 
    color:white; 
    float:left; 
    font:28px Microsoft Sans Serif; 
    text-decoration:none; 
    background: url(left.png) no-repeat; 
} 

#nav a strong { 
    display: inline-block; /* ??? ??????? ?? ????? ?? inline*/ 
    padding:6px 19px 0 0; 
    margin-left:9px; 
    height:52px; 
    float:left; 
    padding-top:10px; 
    cursor:pointer; 
    background: url(button.png) no-repeat right top; 
} 

#nav a:hover{ 
    background: url(lhover.png) no-repeat; 
} 

#nav a:hover strong { 
    background: url(lbutton.png) no-repeat right top; 
} 
#nav a.selected { 
    cursor:default; 
    background: url(lhover.png) no-repeat; 
} 

#nav a.selected strong { 
    cursor:default; 
    background: url(lbutton.png) no-repeat right top; 
} 
#nav a.selected:hover { 
    cursor:pointer; 
    background: url(lhover.png) no-repeat; 
} 

#nav a.selected strong:hover { 
    cursor:pointer; 
    background: url(lbutton.png) no-repeat right top; 
} 
+0

只是一个快速仅供参考,您可以使用:`$( '#登录')addClass( '选择')`代替`.attr()` – hitautodestruct 2011-04-11 07:29:49

回答

1

其最有可能的保证金问题,但使用的包装一起包装的一切,并给它的颜色相同的背景形式:)

+0

我做that.It网络xed。但是当我在#loginform中包装文本时,添加了一些边距/填充,然后显示问题。在slideDown事件开始时,文本是OK。最后 - 文本移动。仅当margin/padding - 左是> = 800,它不会移动 – lam3r4370 2011-02-15 18:03:16