2011-12-07 6 views
3

누구나 드롭 다운 메뉴에서 사람이 클릭하는 위치를 알 수 있으며 사용자가 목록에서 옵션을 선택할 수있는 드롭 다운 목록을 표시합니다. 내가 알고 싶은 것은 html에서 드롭 다운 목록을 표시하는 것을 제외하고 그리드의 옵션 대신 그리드를 표시 할 수있는 방법이 있습니까? 나는 이것을위한 어떤 코드도 얻지 못했다. 그러나 이것이 가능하다는 것을 아는 사람이라면 이것의 예가 될 수있다. 나는 매우 위대 할 것이고 그것은 매우 도움이 될 것이다.html 그리드를 표시하는 방법이 있습니까

+0

나는 당신이하고 싶은 것을 이해하는 것이 약간 어렵다고 생각합니다. – Akos

+0

어 ... 이제까지 드롭 다운으로 보여주고 싶은 것을 제어하고, 드롭 다운 및 비올라로 테이블을 만들 수 있습니다. –

+0

http://www.northcantonschools.org/에서 이러한 컨트롤 중 하나와 비슷한 것을 찾고 계십니까? tech/images/stories/faq-pics/google_documents/insert_table.gif 또는 http://www.blackbeltcoder.com/Articles/controls/colorpicker-controls-for-winforms/ColorPicker.jpg? – Micah

답변

0

여기에 기본적인 예입니다.

/* CSS */ 
.dropdownGrid{position:relative;} 
.dropdownGrid table{position:absolute; z-index:999; display:none;} 
.dropdownGrid td{width:20px; height:20px; background-color:white;} 
.dropdownGrid td:hover{background-color:blue;} 

.

// Javascript using jQuery 
$("#myDropdownGrid button").click(function(){  
    $('#myDropdownGrid table').toggle(); 

}); 
+0

이 기본 예와 나를 도울 수있는 시간을 내 주셔서 감사드립니다. 나는이 예를 내가 원하는대로하기위한 디딤돌으로 사용할 것이다. 대단히 감사한다. – BruceyBandit

0

... 글쎄, '그리드'와 같은 것은 없지만 테이블은 '그리드'형식으로 정보를 제공합니다. div 요소를 사용하여 격자를 만들 수도 있지만 과도하게 지루할 수 있습니다.

jQuery를 사용하고 싶으십니까? 거기에 "없음 표시"

/* make button clickable */ 
$("#someButton").click(function(){ 
    /* grid like container of data, talbe or a complex div 'structure' */ 
    $("#someGrid").toggle() // if grid is visible hide it, if hidden show it 

}) 

는 ... 그래서 당신은 "someButton"의 ID와의 아이디 "someGrid"의 ID와 CSS로 어떤 격자 구조/래퍼 버튼이있을 것이다.

http://jsfiddle.net/QmLmC/

<!-- HTML --> 
<div id="myDropdownGrid" class="dropdownGrid"> 
    <div> 
     <button type="button">Open/Close</button> 
    </div> 
    <table border="1"> 
     <tr> 
      <td>&nbsp;</td> 
      <td>&nbsp;</td> 
      <td>&nbsp;</td> 
      <td>&nbsp;</td> 
     </tr> 
     <tr> 
      <td>&nbsp;</td> 
      <td>&nbsp;</td> 
      <td>&nbsp;</td> 
      <td>&nbsp;</td> 
     </tr> 
     <tr> 
      <td>&nbsp;</td> 
      <td>&nbsp;</td> 
      <td>&nbsp;</td> 
      <td>&nbsp;</td> 
     </tr> 
    </table> 
</div> 
<p>Click the button above to view open or close the grid.</p> 

:

관련 문제