Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery.click和.mouse是否在css3显示上不工作:在html表上工作的表、行、单元格?_Jquery_Css_Mouseevent_Mouseover_Css Tables - Fatal编程技术网

Jquery.click和.mouse是否在css3显示上不工作:在html表上工作的表、行、单元格?

Jquery.click和.mouse是否在css3显示上不工作:在html表上工作的表、行、单元格?,jquery,css,mouseevent,mouseover,css-tables,Jquery,Css,Mouseevent,Mouseover,Css Tables,我有一个由标准html生成的表,它使用JQuery.mouseover事件侦听器以及。单击侦听器。一切正常。此后,我开始从facebookapi收集数据,然后使用divs和CSS在页面上创建信息。该守则的分项数字如下: 以下是jQuery函数: $(document).ready(function() { $('.fbLikeImage').mouseover(function() { $likeID = this.id;

我有一个由标准html生成的表,它使用JQuery
.mouseover
事件侦听器以及
。单击
侦听器。一切正常。此后,我开始从facebookapi收集数据,然后使用divs和CSS在页面上创建信息。该守则的分项数字如下:

以下是jQuery函数:

$(document).ready(function() { 

        $('.fbLikeImage').mouseover(function() {
              $likeID = this.id;

              document.getElementById('uiFBULikeName').innerHTML = this.alt; 
              document.getElementById('uiFBLikeImage').innerHTML = "<img width='70' height='70' class='fbUserImage' src="+ this.src +" >";

                });

        $('.fbLikeImage').click(function(){
            showDiv('uiCommentTextInputWrapper');
            showDiv('likeButtonWrapper');

            });


});
在我将它转换为基于CSS的表格布局之前,它工作得很好。任何想法都很好,我还没有解决这个问题。

$(函数(){
    $(function () { 

        $('.fbLikeImage').mouseover(function() {
              var likeID = $(this).id;

              $('#uiFBULikeName').html($(this).alt); 
              $('#uiFBLikeImage').html("<img width='70' height='70' class='fbUserImage' src=' + $(this).src + ' >")

         });

        $('.fbLikeImage').click(function(){
            $('div uiCommentTextInputWrapper').show();
            $('div likeButtonWrapper').show();

            });
});
I would suggest something like this, but I'm not sure if the click function works like this.. else try by passing the class or ID with it.
$('.fbLikeImage').mouseover(函数(){ var likeID=$(this).id; $('#uiFBULikeName').html($(this.alt); $('#uiFBLikeImage').html(“”) }); $('.fbLikeImage')。单击(函数(){ $('div uiCommentTextInputWrapper').show(); $('div-likeButtonWrapper').show(); }); }); 我建议这样做,但我不确定单击功能是否像这样工作。。否则,通过传递类或ID来尝试。
我想出来了。css DIV表在doc.ready函数执行侦听器之前尚未创建和准备好。我将侦听器放在另一个函数中,并在创建css表的函数末尾调用它们。这样,监听器就不会在生成其他代码之前触发。

这在JSFIDLE中对我来说很有效。您提供的代码缺少“uiFBULikeName”和“uiFBLikeImage”元素以及“showDiv”函数。所以当它到达这些线时,我会出错。
.table{
display:table;
}

.tableRow{
display:table-row;

}
.tableCell{
display:table-cell;
vertical-align:top;

}
    $(function () { 

        $('.fbLikeImage').mouseover(function() {
              var likeID = $(this).id;

              $('#uiFBULikeName').html($(this).alt); 
              $('#uiFBLikeImage').html("<img width='70' height='70' class='fbUserImage' src=' + $(this).src + ' >")

         });

        $('.fbLikeImage').click(function(){
            $('div uiCommentTextInputWrapper').show();
            $('div likeButtonWrapper').show();

            });
});
I would suggest something like this, but I'm not sure if the click function works like this.. else try by passing the class or ID with it.