我有一個很長的模式,並沒有完全顯示在我的Android移動設備上,按鈕是在屏幕下方的波紋管,模態不會滾動,但灰色背景在模態後面,是否有任何css/js技巧來鎖定背景並允許模態在顯示此模式時滾動?Android上的Bootstrap 3長模式滾動背景
3
A
回答
2
這是假設與Bootstrap 3固定,但它不適合我。我能夠用-webkit-overflow-scrolling CSS屬性和設置我的模態的最大高度來解決機智問題。由於我想要我的模式來填充整個屏幕,我不得不連接一些JavaScript來檢測移動設備,並將我的.modal內容的最大高度設置爲我設備的視口高度。沒有解決這個使用一種稱爲jRespond庫:
這個CSS的情態動詞添加
@media (max-width: $screen-xs-max) {
.modal-dialog {
.modal-content {
-webkit-overflow-scrolling: touch;
overflow-y: auto;
}
}
}
添加jRespond到應用程序
https://github.com/ten1seven/jRespond/edit/master/js/jRespond.js
下面的代碼添加到您的main.js腳本
/* This code handles the responsive modal for mobile */
var jRes = jRespond([{
label: 'handheld',
enter: 0,
exit: 767
}]);
jRes.addFunc({
breakpoint: 'handheld',
enter: function() {
$('.modal-content').css('max-height', $(window).height());
$(window).on('orientationchange', function() {
$('.modal-content').css('max-height', $(window).height());
});
},
exit: function() {
$('.modal-content').css('max-height', "");
$(window).off('orientationchange');
}
});
4
這可能是因爲模式的階級地位的是固定的... 嘗試把下面的代碼到你的CSS文件,它是爲我工作...
@media (max-width: 767px) {
.modal {
position: absolute;
overflow:visible;
}
.modal-open {
overflow:visible;
}
}
+0
地獄是的,它的工作!非常感謝分享! – chris
+0
不用客氣......;) –
相關問題
- 1. 檢測背景點擊Bootstrap 3模式
- 2. Bootstrap 3模式背景不灰色
- 3. Android滾動背景
- 4. 防止背景從模式打開時滾動(不是BOOTSTRAP)
- 5. 滾動上的CSS背景模糊
- 6. Android中的背景滾動
- 7. Android的OpenGLES滾動背景
- 8. 背景滾動打開模式
- 9. 滾動背景
- 10. Bootstrap,滾動後沒有背景
- 11. Android遊戲滾動背景
- 12. Bootstrap背景圖片3
- 13. 3垂直div浮動1背景,背景滾動最短
- 14. 滾動背景
- 15. Bootstrap中的響應式動畫背景?
- 16. 滾動背景
- 17. bootstrap模式顯示在背景中
- 18. Bootstrap 3:滾動條
- 19. twitter bootstrap 3移動滾動問題的模式
- 20. 滾動場景背景 - Unity
- 21. Android:巨大的多層滾動背景
- 22. Android:滾動畫廊中的背景
- 23. 我的佈局背景滾動Android
- 24. Bootstrap模態啓用背景
- 25. Bootstrap模態背景問題
- 26. bootstrap模態體背景:無
- 27. 可滾動的背景和Android主要活動上的按鈕
- 28. 滾動背景邊
- 29. Twitter Bootstrap模式背景不包括iPad上的整個屏幕
- 30. VirtualizingTilePanel背景滾動
不工作在andoid 3.13.661.4 – clamchoda