»
Tiếng AnhTiếng PhápTiếng Việt

In - Ẩn/hiện khi rê chuột - JavaScriptBank.com

Phiên bản đầy đủ: jsB@nk » Trình đơn » Định hướng » Ẩn/hiện khi rê chuột
URL: https://www.javascriptbank.com/rollover-text-hide-and-show.html

Ẩn/hiện khi rê chuột © JavaScriptBank.comBạn có thể dùng hiệu ứng JavaScript này để tạo các chú thích cho các đối tượng giống như F.A.Q, các chú thích sẽ được hiển thị khi người dùng rê con trỏ chuột đến và bạn có thể dùng mã HTML cho các chú thích.

Phiên bản đầy đủ: jsB@nk » Trình đơn » Định hướng » Ẩn/hiện khi rê chuột
URL: https://www.javascriptbank.com/rollover-text-hide-and-show.html



CSS
<style type="text/css"><!--dt {  font-weight:bold;}--></style>


JavaScript
<script type="text/javascript"><!--// Created by: Fang :: http://www.webdeveloper.com/forum/showpost.php?p=820426&postcount=2function showHide(parent) {  var aDD=parent.getElementsByTagName('dd');  for(var dd=0; dd<aDD.length; dd++) {    aDD[dd].style.display=(aDD[dd].style.display=='none')? 'block' : 'none';  }}// Multiple onload function created by: Simon Willison// http://simonwillison.net/2004/May/26/addLoadEvent/function addLoadEvent(func) {  var oldonload = window.onload;  if (typeof window.onload != 'function') {    window.onload = func;  } else {    window.onload = function() {      if (oldonload) {        oldonload();      }      func();    }  }}addLoadEvent(function() {var aDT=document.getElementsByTagName('dt');for(var i=0; i<aDT.length; i++) {    aDT[i].onmouseover=aDT[i].onmouseout=Function ('showHide(this.parentNode)');    showHide(aDT[i].parentNode);    }});//--></script>


HTML
<dl>  <dt><a href="http://www.w3.org/">The World Wide Web Consortium</a></dt>    <dd style="display: none;">Develops interoperable technologies (<em>specifications</em>, <em>guidelines</em>, <em>software</em>, and <em>tools</em>) to lead the Web to its full potential.</dd></dl><dl>  <dt><a href="http://en.wikipedia.org/wiki/Unobtrusive_JavaScript">Unobtrusive JavaScript</a></dt>    <dd style="display: none;">The separation of JavaScript functionality (the "behavior layer") from a Web page's structure/content and presentation layers</dd></dl><dl>  <dt>Unrelated stuff (no link)</dt>    <dd style="display: none;">Maquande lingues coalesce, li grammatica del resultant lingue es plusimplic e regulari quam ti del coalescent lingues. Li nov lingua francava esser plu simplic e regulari quam li existent Europan lingues. It vaesser tam simplic quam Occidental.</dd></dl>