有没有办法将其他数据传递到引导模态函数回调?twitter bootstrap模态 - 如何将数据传递给回调函数
例如,让我说我的链接,导致模态打开有一个额外的属性,其中有一些有用的数据,它如何引用该attr?
HTML
<span listid="80" href="#editTaskList" data-toggle="modal" class="btn btn-mini right"><i class="icon-edit"></i> Edit Task List</span>
JS
$('#editTaskList').on('show', function() {
// get the source of the click, and then get the data i need.
});
是的,这是真的。但我觉得它是一种黑客 - 使用显示回调允许我实际上对函数内部的事件进行排序,而不是针对单独的单击事件制定竞争条件。 – Kristian 2012-08-06 03:59:49