질문Q #2097
div를 감추고 싶은데요~
수야디벨2012-11-27 12:14:48
div를 감추고 싶은데요~
<div class="mw_popup open"><!-- mw_popup --> <!-- class="mw_popup open" 이카면 자동으로 열림 -->
<div class="bg"></div>
<div id="popup" style="width:870px; margin:-330px 0 0 -445px;"><!-- 레이어 가로 크기에따라 수동 조절 -->
<div class="pop_content">
<div class="popup_tit">
<h2>게시판 글쓰기</h2>
<a class="close" title="창닫기" href="#popup_anchor"></a>
</div>
<div class="write_item">
<p>
<label for="여기아이디">카테고리</label>
<span>
<select class="type_01">
<option>--</option>
</select>
</span>
</p>
<p>
<label for="여기아이디">제목</label>
<span>
<input type="text" />
</span>
</p>
<p>
<label for="여기아이디">장소</label>
<span>
<input type="text" />
</span>
</p>
</div>
<div class="write_edge">
여기 글쓰기 컴포넌트 / 높이: 560px<br />
여기 글쓰기 컴포넌트 / 높이: 560px<br />
여기 글쓰기 컴포넌트 / 높이: 560px<br />
여기 글쓰기 컴포넌트 / 높이: 560px<br />
여기 글쓰기 컴포넌트 / 높이: 560px<br />
여기 글쓰기 컴포넌트 / 높이: 560px
</div>
<div class="write_info">
<span class="file_tit">첨부파일</span>
<span class="file_info">이미지 <strong>0.2MB</strong></span>
</div>
<div class="write_btn">
<a href="#"><img src="../html/images/main/bbs_btn_01.gif" alt="미리보기" /></a>
<a href="#"><img src="../html/images/main/bbs_btn_02.gif" alt="올리기" /></a>
</div>
</div>
</div>
</div><!-- // mw_popup -->
<!-- 로그인한 세션 정보를 받아온다 -->
예를 들어서 컨트롤러에서 위와같은 view를 호출한다고하면,
무조건 저 div코드로 짜진 화면이 보여지겠지요~?
(물론, 소스에 저 div만 있는건 아닙니다^^)
그런데 뷰를 처음 호출할때, 저 div를 화면에 보여주고 싶지 않은데 가능할까요?
* 제가 시도해본 방법
여러 검색을 통해서 div에 visibility 속성이 있다고 들었습니다.
<body onload=> 를 이용하면, view가 불러지자마자 호출을 하는거잖아요?
그래서 body onLoad를 통해서 바로 scirpt를 호출하고,
scirpt에서
function modal(){
var layout = document.getElementsByClassName("mw_popup");
layout.style.visibility = "hidden";
}
클래스 이름으로 객체를 가져오고, 그거에 대한 스타일(visibility를) hidden으로 하면
안보여주지 않을까~ 했는데 안되네요 ㅠ