2

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

4

2 回答 2

0

我遇到了同样的问题。我找到了解决方案,但我不知道它是如何工作的。解决方案是,添加一些我在下面编写的 jquery 代码。

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

祝你好运!

于 2015-03-29T16:30:12.113 回答
-4

唯一的建议是在 chrome 中单击 F12 并尝试调试。但我最初的猜测是某些 CSS 标准与两个资源管理器不同。

于 2014-01-20T02:45:57.640 回答