jquery动态给子元素绑定事件,将元素内容添加到另一个元素中

        $("#video_grid_box").on("dblclick",".miniStreamView",function($event){
            for(let i=0;i<$("#video_grid_box").children().length;i++){
                if($("#video_grid_box").children()[i].children.length==0){
                    $("#mainVideoView").children().appendTo($("#video_grid_box").children()[i])
                }
            }
            var av = $(this).children();
            console.log(av)
            $("#mainVideoView").empty();
            av.appendTo($("#mainVideoView"))

        })

猜你喜欢

转载自www.cnblogs.com/fqh123/p/12452578.html