简体   繁体   English

如何创建文本输入弹出框

[英]how to create text input pop up box

I need to create a text input pop up box in my laravel application. 我需要在laravel应用程序中创建一个文本输入弹出框。 See the codes below, 参见下面的代码,

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

@foreach ($project->tasks as $task)
  <ul>
    <li>
  <div>
  <div class="pull-right icons-align">
            <a href="" class="editInline"><i class="glyphicon glyphicon-plus"></i></a>
            <a href="" class="editInline"><i class="glyphicon glyphicon-pencil"></i></a>
            <a href="" class="editInline"><i class="glyphicon glyphicon-trash"></i></a>
        </div>
    <h4><a href="/projects/{{$project->id}}/tasks/{{ $task->id }}">{{ $task->task_name }}</a></h4>
 </div>
 </li>
 </ul>
  <hr>
@endforeach
</head>
<script>
$("a.editInline").css("display","none");

$('li').on('mouseover mouseout',function(){
     $(this).find('.editInline').toggle();
     //find the closest li and find its children with class editInLine and 
     //toggle its display using 'toggle()'
});
</script>
</body>

when I click 当我点击

<a href="" class="editInline"><i class="glyphicon glyphicon-plus"></i></a>

this button icon I need to generate text input pop up. 这个按钮图标我需要生成文本输入弹出。 How can I do this? 我怎样才能做到这一点?

<a href="" class="editInline plusInput"><i class="glyphicon glyphicon-plus"></i></a>

var count = 0;
$('.plusInput').click(function(e){
 e.preventDefault();
 count++;
 $('any').append('<input type="text" value="Input '+count+'">');
})

Note: 'any' is Where you want input to be inserted 注意:“ any”是要在其中插入输入的位置

JSFIDDLE DEMO JSFIDDLE演示

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

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