所以當用戶點擊一個按鈕時,我想打開一個彈出窗口,具體取決於頁面的寬度,我希望相應地調整popUp的大小。bootstrap調整頁面未找到視口
找到美味凌晨例如How to detect responsive breakpoints of Twitter Bootstrap 3 using JavaScript?
// Executes only in XS breakpoint
if(viewport.is('xs')) {
// ...
}
// Executes in SM, MD and LG breakpoints
if(viewport.is('>=sm')) {
// ...
}
// Executes in XS and SM breakpoints
if(viewport.is('<md')) {
// ...
}
問題是視點射擊是沒有定義
Uncaught ReferenceError: viewport is not defined
at <anonymous>:1:1
,但我已經在我的腦海包括它
<!--Viewport-->
<meta name="viewport" content="width=device-width, initial-scale=1">
我也有將引導腳本從頭部移動到身體。
有沒有人有任何想法什麼是錯的? ta
如果它是唯一的要求**「我想打開一個彈出窗口,取決於頁面的寬度,我想調整popUp的大小。」**不是定義CSS樣式彈出窗口寬度的解決方案在'%'或'vw'單位中? – Banzay