我有一个锚来打开一个模态:
<a href="#delete-{{ $id }}" class="btn btn-danger btn-xs btn-delete btn-fla details" data-toggle="modal" data-target="#remove_property_modal">
<i class="fa fa-trash"></i>
</a>问题是url没有从http://example.com转换为http://example.com/#delete-4。
发布于 2016-04-28 07:56:21
在引导模式的show.bs.modal事件(文档)上更改url散列
$(document).ready(function () {
$('.modal').on('show.bs.modal', function (e) {
if (typeof (e.relatedTarget) != "undefined") {
window.location.hash = $(e.relatedTarget).attr('href');
}
});
});https://stackoverflow.com/questions/36908267
复制相似问题