bootstrap modal issue in chrome

你说的曾经没有我的故事 提交于 2019-12-08 01:36:00

问题


I have a bootstrap modal in my asp.net mvc code that it's body bind in runtime. first time I click on the some button and modal work good (body return from controller by jquery ajax).

then must change model’s body dynamically , it works good too(by jquery Ajax and json). then I close modal. second time I click on some button , modal work but with problem . the problem is scrollbar of modal's body is enable but not working , like that the modal is lock . this problem is in chrome , but in IE I have not that. my code for modal :

...
success: function (response) {
$('#myModal').html(response);
$('#myModal').modal({ show: true, backdrop: false, keyboard: false });
...

I change css : overflow:hidden and position:fix but it's not work


回答1:


the only suggestion is click F12 in chrome and try to debug. but my initial guess is that some CSS standard is diff with two explorer.




回答2:


I got the same problem. I found the solution, but I don't know How It Works. The solution is, add some jquery codes I wrote below.

  $('.modal').bind('shown.bs.modal', function () {
    $(".modal").css("overflow-y", "scroll");
  });
  $('.modal').bind('hide.bs.modal', function () {
    $(".modal").css("overflow-y", "auto");
  });

Good Luck!



来源:https://stackoverflow.com/questions/19114009/bootstrap-modal-issue-in-chrome

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!