2016-10-17 47 views
0

我目前有引導模態內部的兩個按鈕:如何使Bootstrap模式中的滾動功能從另一個模式打開?

<button type="button" class="left_portfolio_item portfolio_controls"></button> 
<button id="to_modal_two" type="button" class="right_portfolio_item portfolio_controls"></button> 

第二個id爲to_modal_two,點擊後,應關閉第一模態(一中,他是),然後打開第二個。
要做到這一點,我使用jQuery:

$('#to_modal_two').click(function() { 
    $('#modal_one').modal('hide'); 
    $('#modal_two').modal('show'); 
}); 

第一模式是關閉,然後第二個是開放,但unfortunetally我不能用它裏面的滾動功能。
是否有任何解決方法來實現我在尋找的東西?

+0

它的一個按鈕不是文本區域 – Mahi

+0

@mahendrapratapjewaria我不是問如何有按鈕內的滾動,但在模態內。 – MariusNV

+0

而簡單的解決方案可能是在模態('show')上使用setTimeout,模態上也有事件來檢測模態形式是否完全關閉。 – Keith

回答

0

這是我一直在努力,使其工作就像我打算:

我還沒有弄明白如何解決它
$('#to_modal_two').click(function() { 
    $('body').removeClass('modal-open'); 
    $('body').css("padding-right",""); 
    $('#modal_one').removeClass('in'); 
    $('#modal_one').css("display",""); 
    $('#modal_one').attr("aria-hidden","true"); 
    $('.modal-backdrop').hide(); 
    $('#modal_two').modal('show'); 
}); 

的一個錯誤是,當我關閉第二使用「正常方式」訪問第一個模式(<button type="button" data-toggle="modal" data-target="#modal_one"></button>)在打開模式之前,我必須進行2或3次點擊。

相關問題