Chỉ với 1 dòng lệnh kết hợp là bạn có thể tạo 1 button cho phép ẩn hiện nội dung của bạn khi click vào nó. Thủ thuật này ta thường thấy trong các forum ,web , blog... Khi các bạn muốn áp dụng cho bài viết của mình thì cứ việc thay thế chữ màu xanh thành nội dung bài viết của bạn là xong.

<div style="margin-top: 0pt;">
<div style="margin-bottom: 0pt;">
Nội dung hiển thị<input onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Ẩn nội dung'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Hiện nội dung'; }" style="font-size: 14px; padding: 0px 5px;" type="button" value="Ẩn/Hiện" /></div>
<div style="margin: 0px;">
<div class="codeview" style="display: none;">
Nội dung muốn ẩn, hiện</div>
</div>
</div>



![[Thủ thuật yêu cầu] Tạo dock Menu đính trượt bên phải màn hình giống ThaiAiTi.com [Thủ thuật yêu cầu] Tạo dock Menu đính trượt bên phải màn hình giống ThaiAiTi.com](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9km-Gk4U6GT4Vthq4Sam-1s297oz7HV2NH6RDH-RoZiG36O8u-OrfnWv0t4iYgnll-izu2anaLZ8SA6VmFnFTCA02dLjFjDb9tDEDwXD5xjG-oDogaeOJJZ5X_QVQETH3wIfxZcWfGd1S/s72-c/%E1%BA%A2nh+ch%E1%BB%A5p+m%C3%A0n+h%C3%ACnh_2014-12-30_205038.png)


0 nhận xét:
Đăng nhận xét