How can I make jQuery do something if my screen width is less than 960 pixels?(如果我的屏幕宽度小于960像素,我如何让jQuery做一些事情?)
The code below always fires the 2nd alert, regardless of my window size:(无论窗口大小如何,下面的代码始终会触发第二个警报:)
if (screen.width < 960) {
alert('Less than 960');
}
else {
alert('More than 960');
}
ask by Evanss translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…