[JQuery]table
js 代码
- <script type="text/javascript">
- $(document).ready(function(){
- $(".stripeMe tr").mouseover(function() {$(this).addClass("over");}).mouseout(function() {$(this).removeClass("over");});
- $(".stripeMe tr:even").addClass("alt");
- });
- </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
:evil: