Skip to content

Commit 17db886

Browse files
author
zhangyonghong
committed
update
1 parent a41518b commit 17db886

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

css.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,4 +334,24 @@ window.addEventListener("onorientationchange" in window ? "orientationchange" :
334334
}
335335
}, false);
336336
//移动端的浏览器一般都支持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+
337357
```

0 commit comments

Comments
 (0)