잡담소장소

jQuery .show()에서의 block or inline 본문

Study ;3

jQuery .show()에서의 block or inline

유부뽀 2013. 1. 31. 14:34


회원가입페이지를 만들다가 특정 케이스에서 .show()할 때 block이 아니라 inline값으로 잡혀서 

페이지 디자인이 깨지는 현상이 발견되었다.


일단 대체로 .show() 하는 대신에 .css('display', 'block') 으로 해결하긴 했는데

왜!

WHY!

궁금해서 구글링해보았다.


나같은 사람도 한둘 있었던 것 같다.

자신은 어떻게 해결했고, 어떻게 해결해야하는지에 대한 리플들만 있을뿐

명확한 이유를 이야기하는 리플은 없었다.

그래서 jQuery사이트에서 .show()에 대한 설명을 보았는데

display:inline으로 초기설정이 되어있으면 show/hide할때 inline속성을 갖게되고

나머지는 block으로 표시된다는 설명이 있었다.


The matched elements will be revealed immediately, with no animation. This is roughly equivalent to calling.css('display', 'block'), except that the display property is restored to whatever it was initially. If an element has adisplay value of inline, then is hidden and shown, it will once again be displayed inline.


단순 버그인걸까.

css가 어떻게 잡혀있는지 보지 않아서 잘 모르겠다 'ㅅ' 데헷.

반응형
Comments