<legend id='nSt0o'><style id='nSt0o'><dir id='nSt0o'><q id='nSt0o'></q></dir></style></legend>
<tfoot id='nSt0o'></tfoot>

<small id='nSt0o'></small><noframes id='nSt0o'>

  • <i id='nSt0o'><tr id='nSt0o'><dt id='nSt0o'><q id='nSt0o'><span id='nSt0o'><b id='nSt0o'><form id='nSt0o'><ins id='nSt0o'></ins><ul id='nSt0o'></ul><sub id='nSt0o'></sub></form><legend id='nSt0o'></legend><bdo id='nSt0o'><pre id='nSt0o'><center id='nSt0o'></center></pre></bdo></b><th id='nSt0o'></th></span></q></dt></tr></i><div id='nSt0o'><tfoot id='nSt0o'></tfoot><dl id='nSt0o'><fieldset id='nSt0o'></fieldset></dl></div>
        <bdo id='nSt0o'></bdo><ul id='nSt0o'></ul>

        jQuery悬停在表格上的效果

        jQuery hover effect over table(jQuery悬停在表格上的效果)
          <tbody id='VvTDP'></tbody>

              <bdo id='VvTDP'></bdo><ul id='VvTDP'></ul>

                <tfoot id='VvTDP'></tfoot>

                <small id='VvTDP'></small><noframes id='VvTDP'>

                • <legend id='VvTDP'><style id='VvTDP'><dir id='VvTDP'><q id='VvTDP'></q></dir></style></legend>

                  <i id='VvTDP'><tr id='VvTDP'><dt id='VvTDP'><q id='VvTDP'><span id='VvTDP'><b id='VvTDP'><form id='VvTDP'><ins id='VvTDP'></ins><ul id='VvTDP'></ul><sub id='VvTDP'></sub></form><legend id='VvTDP'></legend><bdo id='VvTDP'><pre id='VvTDP'><center id='VvTDP'></center></pre></bdo></b><th id='VvTDP'></th></span></q></dt></tr></i><div id='VvTDP'><tfoot id='VvTDP'></tfoot><dl id='VvTDP'><fieldset id='VvTDP'></fieldset></dl></div>
                  本文介绍了jQuery悬停在表格上的效果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我是 jQuery 新手,我正在尝试在我的桌子上制作悬停效果,但我不知道如何操作.我只想将文本设为红色,然后在失去焦点时如何再次删除红色.

                  这是我目前所拥有的:

                  <script type="text/javascript">$(函数(){$('tr').hover(函数() {$(this).css('color', 'red')});});</脚本><表格边框="1"><tr><th>ID</th><th>名字</th></tr><tr><td>#1</td><td>ole</td></tr><tr><td>#2</td><td>杰弗里</td></tr><tr><td>#3</td><td>柯林</td></tr><tr><td>#4</td><td>前夕</td></tr></表>

                  解决方案

                  你需要做的就是传递另一个函数来悬停鼠标离开.

                  $('tr').hover(function() {$(this).css('color', 'red');}, 功能() {$(this).css('color', '');});

                  请参阅 jsfiddle 上的示例.

                  或者你也可以只在 css 中完成.

                  tr:hover{红色;}

                  <块引用>

                  IE 5/6 只支持链接.IE7 支持:hover,但不支持:active, on所有元素.来自这里.

                  I am new to jQuery and I am trying to make a hover effect on my table but I don't know how. I would like to make only the text red and then how to remove the red color again when the focus has been lost.

                  This is what I have so far:

                  <script type="text/javascript">
                  $(function() {
                      $('tr').hover(function() {
                          $(this).css('color', 'red')
                      });
                  });
                  </script>
                  
                  
                  <table border="1">
                      <tr>
                          <th>ID</th>
                          <th>name</th>
                      </tr>
                      <tr>
                          <td>#1</td>
                          <td>ole</td>
                      </tr>
                      <tr>
                          <td>#2</td>
                          <td>jeffrey</td>
                      </tr>
                      <tr>
                          <td>#3</td>
                          <td>collin</td>
                      </tr>
                      <tr>
                          <td>#4</td>
                          <td>eve</td>
                      </tr>
                  </table>
                  

                  解决方案

                  All you need to do is pass another function to hover for the mouse leave.

                  $('tr').hover(function() {
                      $(this).css('color', 'red');
                  }, function() {
                      $(this).css('color', '');
                  });
                  

                  See example on jsfiddle.

                  Or you could do it only in css as well.

                  tr:hover{
                      color:red;
                  }
                  

                  IE 5/6 supports both only on links. IE 7 supports :hover, but not :active, on all elements. from here.

                  这篇关于jQuery悬停在表格上的效果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Move link image 5px up on hover(悬停时将链接图像向上移动 5px)
                  How do I inspect CSS pseudo classes with firebug?(如何使用 firebug 检查 CSS 伪类?)
                  Why doesn#39;t CSS hover work on table rows when the cells inside the rows have class names?(当行内的单元格具有类名时,为什么 CSS 悬停在表格行上不起作用?)
                  Hover image - display div over it(悬停图像 - 在其上显示 div)
                  How to apply a CSS class on hover to dynamically generated submit buttons?(如何在悬停时将 CSS 类应用于动态生成的提交按钮?)
                  Differences between CSS3 :hover and :focus?(CSS3 :hover 和 :focus 的区别?)

                  <i id='qO45h'><tr id='qO45h'><dt id='qO45h'><q id='qO45h'><span id='qO45h'><b id='qO45h'><form id='qO45h'><ins id='qO45h'></ins><ul id='qO45h'></ul><sub id='qO45h'></sub></form><legend id='qO45h'></legend><bdo id='qO45h'><pre id='qO45h'><center id='qO45h'></center></pre></bdo></b><th id='qO45h'></th></span></q></dt></tr></i><div id='qO45h'><tfoot id='qO45h'></tfoot><dl id='qO45h'><fieldset id='qO45h'></fieldset></dl></div>
                      <bdo id='qO45h'></bdo><ul id='qO45h'></ul>
                      • <small id='qO45h'></small><noframes id='qO45h'>

                          <tbody id='qO45h'></tbody>
                      • <legend id='qO45h'><style id='qO45h'><dir id='qO45h'><q id='qO45h'></q></dir></style></legend>

                          <tfoot id='qO45h'></tfoot>