2011-02-15 16 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

그냥 빨리 사용할 수 있습니다 : $ ('# login') .addrass ('selected')'대신에 .attr()' – hitautodestruct

답변

1

가장 가능성이 마진 문제가 있지만, 모든 것을 함께 포장하고 그것에게 같은 색상의 배경을 제공하는 래퍼를 사용 양식 :)

+0

나는 그것을했다. xed.But #loginform 텍스트를 래핑 할 때 약간의 여백/패딩을 추가 한 다음 문제가 나타났습니다. slideDown 이벤트의 시작 부분에서 텍스트는 OK입니다. 결국 - 텍스트가 이동합니다. 여백/패딩 만 - 왼쪽은> 800, 이동하지 않습니다. – lam3r4370

+0

당신은 래퍼에 여백과 패딩을 추가하지 않습니다. – Val

관련 문제