`
yepp
  • 浏览: 17916 次
  • 来自: 苏州
最近访客 更多访客>>
社区版块
存档分类
最新评论

[JQuery]table

    博客分类:
  • Web
阅读更多
js 代码
  1. <script type="text/javascript">   
  2. $(document).ready(function(){   
  3. $(".stripeMe tr").mouseover(function() {$(this).addClass("over");}).mouseout(function() {$(this).removeClass("over");});   
  4. $(".stripeMe tr:even").addClass("alt");   
  5. });   
  6. </script>  

 

  • $('p') = find all paragraphs
  • $('.whatever') = find everything with class="whatever"
  • $('.stripeMe tr') = find all tr (table rows) inside an element with the "stripeMe" class
  • In the code:$(".stripeMe tr").... find all rows of a table with class="stripeMe"
  • the code:$(".stripeMe tr:even")......any table with class name "stripeMe" will be striped
  • $('.whatever').mouseover() tells jQuery "Everything with class name 'whatever' will have a new onMouseover event
  • 分享到:
    评论
    1 楼 nusys_gwh 2009-01-08  

    相关推荐

    Global site tag (gtag.js) - Google Analytics