Achieve the gradual expansion of the table when clicked! _javascript Tips

Source: Internet
Author: User
I've seen this effect on a flash RIA site and it's a good visual effect. Flash developers may also use this to show that Flash's application in the dynamic effect is better than JS (personal point of view). Later, when I was doing bmail, GIF animation as a background, the basic realization of this function, but always feel less perfect. This time the practice is to use a filter, visually smoother, but also saved the picture download trouble.
<style> #tbList th{text-align:left;padding-left:20;border:1px Solid white;border-right:1px solid #7994BF; border-bottom:1px Solid #7994BF} #tbList td{padding-left:6;border-top:1px solid white;border-bottom:1px Solid #CDD0E1} </style> <body style=font-size:12> <table id=tblist cellpadding=0 cellspacing=0 width=100% style=cursor :d efault;font-size:12> <tr height=25 bgcolor= #C1D1EA > <th width=160> Senders </th> & Lt;th> Theme </th> <th width=90> date </th> <th width=90> size </th> </tr&gt ; <tr height=25> <td> Guan Yu </td> <td> Grand </td> <td>8 month 7th &LT;/TD&G T <td>4k</td> </tr> <tr height=25> <td> Zhang </td> <td> long Board slope A roar, scare back 100,000 Xiong </td> <td>3 month 24th </td> <td>5k</td> </tr> <tr Hei Ght=25> <td> Zhao </td> <td> most handsome zhaozilong </td> <td>3 month 24th </td> <td>3k </td> </tr> </table> >> Click on the above table to see the row fade effect </body> <script> Document.getele Mentbyid ("Tblist"). Onmousedown=function (e) {var tb=this,tr,ee ee=e==null?event.srcelement:e.target if (ee.ta gname!= "TD") return Tr=ee.parentnode if (tb.selrow!=null) settrreveal (Tb.selrow, "Background:whi TE ", 1) settrreveal (tr," background: #EAEAEA ") tb.selrow=tr} function Settrreveal (tr,css,nodelay) {var i if (!document.all) return tr.style.csstext+= ";" +css for (i=0;i< tr.cells.length;i++) {if (nodelay) {tr.cells[i].style.csstext+= ";" +css continue} tr.cells[i].style.filter= "Progid:DXImageTransform.Microsoft.RevealTrans (dur ATION=0.5,TRANSITION=16) "Tr.cells[i].filters[0].apply () Tr.cells[i].style.csstext+= ";" +css tr.cells[i].filters[0].play ()} </script>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.