jquery里边如何带参数?有一个表格table 其中的一个td里我放了一个文字外加一个显示时间的DIV  我想实现鼠标移上去(td中的文字)后显示div(时间的DIV)一个table只有一行的话 这个很容易实现  但是如果我循环输出数据库中的数据  如果有10条的话  每移动到一个文字上  要显示该条数据的时间  这个用jquery 如何写啊?一行的js: $(function () {
$("#deal_select").mouseover(function() {  
        $("#listtimecont").show();  
    }).mouseout(function() {  
        $("#listtimecont").hide();  
    });  
        }); 

解决方案 »

  1.   

    $('table td').mouseover(function(){
     $(this).show();
    }).mouseout(function(){$(this).hide();});
      

  2.   

    谢谢chhxxc  你这样写的话  td下的div不会显示的。我的意思不是这样哦~!~!
      

  3.   


    LZ,贴出你那个完整的table来,行数就几行就行。因为不清楚你的结构。不好说。这个东东,再简单不过的事了
      

  4.   

    不知道你table具体的结构,你看看是不是这个样子
    <table id="mytable">
      <tr>
        <td>文本<div>时间</div></td>
      </tr>
     <tr>
        <td>文本</td>
      </tr>
      <tr>
        <td>文本<div>时间</div></td>
      </tr>
      <tr>
        <td>文本<div>时间</div></td>
      </tr>
    </table>
    <script type="text/javascript">
    $(function(){
        $("#mytable td").bind({
            "mouseover":function(){
                $(this).find("div").show();
            },
            "mouseout":function(){
                $(this).find("div").hide();
            }
        })
    })
    </script>
      

  5.   

    如果要那些文本后面的div默认隐藏,就改成这样
    <script type="text/javascript">
    $(function(){
        $("#mytable td div").hide();
        $("#mytable td").bind({
            "mouseover":function(){
                $(this).find("div").show();
            },
            "mouseout":function(){
                $(this).find("div").hide();
            }
        })
    })
    </script>