File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -334,4 +334,24 @@ window.addEventListener("onorientationchange" in window ? "orientationchange" :
334
334
}
335
335
}, false );
336
336
// 移动端的浏览器一般都支持window.orientation这个参数,通过这个参数可以判断出手机是处在横屏还是竖屏状态。
337
+ ```
338
+
339
+ - [ iOS,Safari浏览器,input等表单focus后fixed元素错位问题] ( https://www.snip2code.com/Snippet/176582/--iOS-Safari----input---focus-fixed----- )
340
+ ``` javascript
341
+ if ( / iPhone| iPod| iPad/ i .test (navigator .userAgent ) ) {
342
+ $ (document ).on (' focus' , ' input, textarea' , function ()
343
+ {
344
+ $ (' header' ).css (" position" , ' absolute' );
345
+ $ (' footer' ).css (" position" , ' absolute' );
346
+
347
+ });
348
+
349
+ $ (document ).on (' blur' , ' input, textarea' , function ()
350
+ {
351
+ $ (' header' ).css (" position" , ' fixed' );
352
+ $ (' footer' ).css (" position" , ' fixed' );
353
+
354
+ });
355
+ }
356
+
337
357
```
You can’t perform that action at this time.
0 commit comments