简体   繁体   English

javascript不显示表格值html

[英]javascript not displaying table values html

I'm creating a JavaScript application that when you hover the mouse a small window pops up displaying information about the value displayed in the cell. 我正在创建一个JavaScript应用程序,当您将鼠标悬停在上面时,会弹出一个小窗口,显示有关单元格中显示的值的信息。 The function is shown bellow. 该功能显示如下。 However, when I load the page, nothing is shown when I hover the mouse over the cell, although when I run that function from firebug's terminal, it starts working as supposed. 但是,当我加载页面时,将鼠标悬停在单元格上时,没有显示任何内容,尽管当我从firebug的终端运行该函数时,它按预期开始工作。 Why ideas why? 为什么会有想法?

$(document).ready(function()
        {
            $('#mytable td').qtip({
                content : {
                    text : function(api){
                        return "Time spend: " + $(this).html();
                    }
                },
                position : {
                    my : 'top left',
                    target : 'mouse',
                    viewport : $(window),       //keep it on-screen at all time if possible
                    adjust : {
                        x : 10, y : 10
                    }
                },
                hide : {
                    fixed : true                // Helps to prevent the tooltip from hiding occassionaly when tracking!
                },
                style : 'ui-tooltip-shadow'
            });
        });

and the HTML 和HTML

<div id="mytable">
<table id="mytable" border="1px">
<tbody>
<tr>
<td style="background-color: rgb(0, 191, 255);">1</td>
<td style="background-color: rgb(0, 191, 255);">1</td>
<td style="background-color: rgb(0, 191, 255);">1</td>

This is just a sample of the table. 这只是表的一个示例。 The table itself is huge (a heatmap) 桌子本身很大(一个热图)

Please add overwrite and show properties to it and see if it works. 请为其添加覆盖并显示属性,然后查看其是否有效。

For example: 例如:

$(this).qtip({
      overwrite: false, // make sure it can't be overwritten
      content: 'bla bla bla'
      show: {
         ready: true // make sure it show on first mouseover
      }
   })

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM