我有以下演示网站:http://woohooo.fortleet.com/
内容和导航设置为100%高度.当我在我的手机上时,当我向上滚动时,顶部有这个url栏.但是,这种效果会影响100%的高度,因为它会调整到新的浏览器大小,从而产生令人不快的效果.'vh'和'vw'单位也是如此.
我尝试过以下方法:
function windowDimensions() {
if (html.hasClass('touch')) {
height = window.screen.height;
width = window.screen.width;
} else {
height = win.height();
width = win.width();
}
}
function screenFix() {
if (html.hasClass('touch')) {
touch = true;
nav.css({'height' : height + 'px'});
home.css({'height' : height + 'px'});
header.css({'height' : height/2 + 'px'});
content.css({'min-height' : height + 'px'});
}
}
Run Code Online (Sandbox Code Playgroud)
然而,这会产生一个问题,因为在非常顶级的情况下,这个条形电池,wifi,信号信息也会占据屏幕高度,使'100%'和'vh'元素更大一些.
我无法相信我没有发现任何其他问题,因为我认为这是100%/ 100%网站的一个相当常见的问题.
你们知道对此有什么解决方法吗?
tl; dr:有人可以解释在这两个平台之间实现客户端Google登录流程的不同之处究竟是什么?
背景故事:
我一直在努力实现客户端Google登录我的网站.首先,我使用标签实施了全球设置的Google+平台,因此可以监控用户会话.得到的信息:https://developers.google.com/+/web/signin/
但是,我遇到了一个问题,如果用户没有登录,网站将自动检查用户登录状态,这导致许多'toastr'消息'Logged out',我在signInCallback函数中实现.这真令人生气.
所以我做了一些研究,偶然发现了他们的"快速启动应用程序"并浏览了它.它比指南更复杂,许多元素都记录在Google Identity Platform上,在这里:https: //developers.google.com/identity/sign-in/web/reference
现在我真的不明白实现他们的登录的正确方法是什么 - 它是轻量级的Google+按钮,带有用户状态的标签回调检查,还是与监听器,gapi实例等所有的强大的GIP方式?这些平台有何不同之处?
假设您像这样定义组件:
interface IProps {
req: string;
defaulted: string;
}
class Comp extends React.Component<IProps, void> {
static defaultProps = {
defaulted: 'test',
};
render() {
const { defaulted } = this.props;
return (
<span>{defaulted.toUpperCase()}</span>
);
}
}
Run Code Online (Sandbox Code Playgroud)
当你想使用它时,TypeScript需要defaulted你的道具,即使它在以下定义defaultProps:
<Comp req="something" /> // ERROR: TypeScript: prop 'defaulted' is required
Run Code Online (Sandbox Code Playgroud)
但是,如果你像这样定义道具界面:
interface IProps {
req: string;
defaulted?: string; // note the ? here
}
Run Code Online (Sandbox Code Playgroud)
然后你不能用它:
render() {
const { defaulted } = this.props; // ERROR: prop 'defaulted' possibly undefined …Run Code Online (Sandbox Code Playgroud) javascript ×3
client ×1
css ×1
google-plus ×1
html ×1
jquery ×1
mobile ×1
reactjs ×1
typescript ×1
web ×1