Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/370.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
Javascript jQuery移动元素未正确显示_Javascript_Jquery_Jquery Mobile - Fatal编程技术网

Javascript jQuery移动元素未正确显示

Javascript jQuery移动元素未正确显示,javascript,jquery,jquery-mobile,Javascript,Jquery,Jquery Mobile,我正在使用jQuery Mobile显示一个表。 但是,当我使用addMore按钮添加新行时,显示关闭!为什么会这样?它应该在第一排后面。另外,它在我的浏览器上以黑色主题显示。。。但它应该是白色的,就像小提琴一样。为什么? 这是我的小提琴: 这是添加新行的代码 var addmore = '<tr><td style="text-align: center">' + currentIndex + '</td>' + '<td class="sma

我正在使用jQuery Mobile显示一个表。 但是,当我使用
addMore
按钮添加新行时,显示关闭!为什么会这样?它应该在第一排后面。另外,它在我的浏览器上以黑色主题显示。。。但它应该是白色的,就像小提琴一样。为什么?

这是我的小提琴:

这是添加新行的代码

var addmore = '<tr><td style="text-align: center">' + currentIndex + '</td>' +
    '<td class="small">' +
    '<div data-role="fieldcontain" class="ui-hide-label">' +
    '<label for="number_' + currentIndex + '">Response Number</label>' +
    '<input type="text" name="number_' + currentIndex + '" id="number_' + currentIndex + '" value="" placeholder="Response Number"/>' +
    '</div></td><td>' +


    '<div data-role="fieldcontain" class="ui-hide-label">' +
    '<label for="label_' + currentIndex + '">Description</label>' +
    '<input type="text" name="label_' + currentIndex + '" id="label_' + currentIndex + '" value="" placeholder="Description "/>' +
    '</div></td></tr>';
var addmore=''+currentIndex+''+
'' +
'' +
“回复号码”+
'' +
'' +
'' +
“说明”+
'' +
'';
另外,如何删除该行?

您要执行
$(.config”).trigger(“创建”)在最后解决样式问题

更新的小提琴链接是

$(“#添加更多”)。单击(函数(){
currentIndex=$(“.config tr:last td:first”).text()
如果(currentIndex==“”){currentIndex=0}
currentIndex=parseInt(currentIndex)+1
var addmore=''+currentIndex+''+
'' +
'' +
“回复号码”+
'' +
'' +
'' +
“说明”+
'' +
'';
++电流指数;
$('#labels.config tr:last')。在(addmore)之后;
$(“.config”).trigger(“创建”);
});
$(“#删除”)。单击(函数(){
$(“.config tr:last”).remove();
});

注意:我修复了样式问题并删除了函数。

要删除行,只需添加
$(“#RowID”).remove()@DavorMlinaric非常感谢:D
$("#addMore").click(function () {
    currentIndex = $(".config tr:last td:first").text()
    if(currentIndex == ""){currentIndex = 0}
    currentIndex = parseInt(currentIndex) + 1
    var addmore = '<tr><td style="text-align: center">' + currentIndex + '</td>' +
        '<td class="small">' +
        '<div data-role="fieldcontain" class="ui-hide-label">' +
        '<label for="number_' + currentIndex + '">Response Number</label>' +
        '<input type="text" name="number_' + currentIndex + '" id="number_' + currentIndex + '" value="" placeholder="Response Number"/>' +
        '</div></td><td>' +


        '<div data-role="fieldcontain" class="ui-hide-label">' +
        '<label for="label_' + currentIndex + '">Description</label>' +
        '<input type="text" name="label_' + currentIndex + '" id="label_' + currentIndex + '" value="" placeholder="Description "/>' +
        '</div></td></tr>';

     ++currentIndex;
    $('#labels .config tr:last').after(addmore);
    $(".config").trigger("create");
});

$("#remove").click(function(){
    $(".config tr:last").remove();
});