ITeye博客

[JQuery]table

yepp · 2006-11-21 09:47 · Web · Markdown

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)

  1. #1 楼 · nusys_gwh · 2009-01-08 15:26

    :evil:

评论功能维护中,当前仅展示历史评论。