2012-03-22 4 views

답변

9

이것은 CSS와 자바 스크립트에서도 가능합니다. 요소와 테이블을 만듭니다

<table> 
<tr><td> 
    <a href="#">Info 
     <div class="tooltipcontainer"> 
      <div class="tooltip">Here some info</div> 
     </div> 
    </a> 
</td></tr> 
</table> 

CSS :

/* Container is necessary because td cannot be positioned relative */ 
td .tooltipcontainer { 
    position: relative; 
} 
td .tooltip { 
    display: none; 
    position: absolute; 
    /* More positioning, heigh, width, etc */ 
} 
td a:hover .tooltip { 
    display: block; 
} 

당신이 '정보'위에 마우스를 올려 때이 클래스 = '툴팁'와 사업부의 텍스트를 표시합니다. JavaScript (예 : 모든 jQuery 툴팁 플러그인)에는 더 많은 옵션이 포함 된 솔루션이 있습니다.

+0

이것은 수 우리에게 더 좋을거야. y tbh – mickburkejnr

+0

고맙습니다. 이것은 제가 찾고 있던 CSS 솔루션의 종류였습니다. 그러나 Javascript 솔루션에는 더 많은 이점이 있다고 생각합니다. – DextrousDave

2

전에 Tooltip JS을 사용했습니다. 그것은 정말 잘 작동했고 나는 그것이 당신에게 유익 할 것이라고 생각합니다.

+0

덕분에,이 멋진 솔루션 – DextrousDave

3

예 마크 업 ..

<td id="1">..</td> 
<td id="2">..</td> 
<td id="thisiswhatiwanttohaveahover"><div class="tooltip hidden"></div></td> 

CSS 스타일

.visible { 
    display:block; 
} 

.hidden { 
    display:none; 
} 

이 도움이

$('#thisiswhatiwanttohaveahover').hover(function() { 
    if ($(this + ' .tooltip').hasClass('hidden')) { 
    $(this + ' .tooltip').removeClass('hidden'); 
    $(this + ' .tooltip').addClass('visible'); 
    } 
    if ($(this + ' .tooltip').hasClass('visible')) { 
    $(this + ' .tooltip').removeClass('visible'); 
    $(this + ' .tooltip').addClass('hidden'); 
    } 
}); 

희망 ..

+0

고마워, 이건 좋은 JS 솔루션 같아. 그것을 시도 할 것입니다 – DextrousDave

+0

.. 다행 도움 : –

관련 문제