2012-07-27 66 views
4

我已經看到了在系統啓動的JS方針,這代碼禁止Twitter的引導模式:禁止Twitter的引導模式

$('#myModal').on('show', function (e) { 
if (!data) return e.preventDefault() // stops modal from being shown 
}) 

然而,在點擊模式,它不會打開的對象(圖像,在這種情況下,使用引導圖像庫:https://github.com/blueimp/Bootstrap-Image-Gallery)。它只是完全禁用了點擊功能。

我也試了這個片段,以禁用模態空間:

$(document.body).off('.modal-gallery.data-api') 

但它似乎並沒有將其禁用。

我該如何編寫jQuery,以便禁用模式圖庫並定期將圖像作爲鏈接打開? (在所有腳本執行完畢後,需要將此代碼片段用於執行腳本的移動站點。)

回答

4

您可以通過刪除data-toggle =「modal」來禁用自動模式綁定並綁定您的單擊事件

$('#mybutton').click(function (e) { 
    if (data) { 
    e.preventDefault(); 
    $('#myModal').modal(); 
    } 
}); 
0

這會打開沒有引導模式的圖像。

div id="blueimp-gallery" class="blueimp-gallery blueimp-gallery-controls" data-use-bootstrap-modal="false"