Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangyonghong committed Sep 28, 2015
1 parent a41518b commit 17db886
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions css.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,4 +334,24 @@ window.addEventListener("onorientationchange" in window ? "orientationchange" :
}
}, false);
//移动端的浏览器一般都支持window.orientation这个参数,通过这个参数可以判断出手机是处在横屏还是竖屏状态。
```

- [iOS,Safari浏览器,input等表单focus后fixed元素错位问题](https://www.snip2code.com/Snippet/176582/--iOS-Safari----input---focus-fixed-----)
```javascript
if( /iPhone|iPod|iPad/i.test(navigator.userAgent) ) {
$(document).on('focus', 'input, textarea', function()
{
$('header').css("position", 'absolute');
$('footer').css("position", 'absolute');

});

$(document).on('blur', 'input, textarea', function()
{
$('header').css("position", 'fixed');
$('footer').css("position", 'fixed');

});
}

```

0 comments on commit 17db886

Please sign in to comment.