有没有办法在单击时显示至少10个模态窗口?

时间:2015-06-02 03:59:56

标签: php html css

每当用户点击按钮时,我都会使用此代码显示模态。

return redirect()->back()->with('message', 'Permintaan berhasil diinput');

是否有方法或功能只需点击一下即可在屏幕上显示至少10个具有不同位置的模态?

1 个答案:

答案 0 :(得分:1)

是的,你可以使用Jquery来做到这一点。

假设按钮的id为'modalOpen' 你可以写:

$('#modalOpen').click(function(){
  $('.modal1').show(function(){
      $(this).css('top', '100px');
  });
  $('.modal2').show(function(){
      $(this).css('top', '200px');
  });
  ....
});

通过这种方式,您可以添加所需的模式,当用户点击ID为'modalOpen'的按钮时,该模态将会打开