我注意到iOS 10中有一个带有CSS scroll-snap属性的奇怪错误.
这是我的css:
#springBoard{
height: 100%;
width: 100%;
font-size: 0px;
white-space: nowrap;
overflow: scroll;
-webkit-overflow-scrolling: touch;
-webkit-scroll-snap-type: mandatory;
-webkit-scroll-snap-points-x: repeat(100%);
}
section{
display: inline-block;
width: 100%;
height: 100%;
vertical-align: top;
font-size: 16px;
}
Run Code Online (Sandbox Code Playgroud)
如果我以编程方式滚动到捕捉点,然后更改滚动捕捉容器内的内容,导航将捕捉到第一个捕捉点.
// Programatically scroll the scroll-snap container
$("#springBoard")[0].scrollLeft = 320
Run Code Online (Sandbox Code Playgroud)
它似乎与我触发滚动的方式无关.所有这些滚动方法都会产生相同的结果:
$("#springBoard")[0].scrollLeft = 320
$("#springBoard").animate({scrollLeft: 320}, 1)
$("#springBoard > section:eq(1)")[0].scrollIntoView()
window.location.hash = "sectionId"
Run Code Online (Sandbox Code Playgroud)
我花了几天时间试图解决这个问题但到目前为止没有成功.
有没有人知道绕过这个我的目标是连接两个字符串。
这是我的 bash 脚本的复制粘贴:
str1="Hello"
str2="World"
str3=$str1$str2
echo $str3
Run Code Online (Sandbox Code Playgroud)
预期的输出是,HelloWorld但我得到的World却是。
当我在终端中运行它时它工作正常。
cat -v这是我运行脚本时的输出:
str1="Hello"^M
str2="World"^M
str3=$str1$str2^M
echo $str3^M
Run Code Online (Sandbox Code Playgroud)
我错过了什么吗?
我\xe2\x80\x99m 很难理解我的水平 Pod 自动缩放器发生了什么\xe2\x80\x99s。
\n\n如果内存或 CPU 使用率超过 80%,I\xe2\x80\x99m 会尝试扩展我的部署。
\n\n这里\xe2\x80\x99是我的HPA模板:
\n\napiVersion: autoscaling/v2beta2\nkind: HorizontalPodAutoscaler\nmetadata:\n name: my-hpa\nspec:\n scaleTargetRef:\n apiVersion: apps/v1\n kind: Deployment\n name: my-deployment\n minReplicas: 2\n maxReplicas: 10\n metrics:\n - type: Resource\n resource:\n name: cpu\n target:\n type: Utilization\n averageUtilization: 80\n - type: Resource\n resource:\n name: memory\n target:\n type: Utilization\n averageUtilization: 80\nRun Code Online (Sandbox Code Playgroud)\n\n问题是,尽管使用率低于 80%,但它\xe2\x80\x99 已经在 3 个副本上呆了好几天了,而且我不\xe2\x80\x99 不明白为什么。
\n\n$ kubectl get hpa --all-namespaces\n\nNAMESPACE NAME REFERENCE TARGETS MINPODS MAXPODS REPLICAS AGE\nmy-ns my-hpa Deployment/my-deployment 61%/80%, 14%/80% 2 10 3 2d15h\n …Run Code Online (Sandbox Code Playgroud) autoscaling kubernetes kubernetes-pod horizontal-pod-autoscaling