想要实现一个效果:按钮的背景渐变色,在点击之后,自动往下移,超出按钮的范围。
目前在开发工具上一切正常,但是在iPhone上【预览】的时候,就无法实现超出隐藏,背景变成了移动到下面。
开发工具:
iPhone(注意看test字样和背景的位置):
代码片段:https://developers.weixin.qq.com/s/apIQrymm7UKP
wxml:
test
wxss:
#test{
background: linear-gradient(to bottom right, #e6666e, #cccccc, #e6666e);
background-repeat: no-repeat;
position: absolute;
width: 100px;
height: 60px;
left: 200px;
top: 400px;
text-align: center;
line-height: 60px;
border-radius: 16px;
transition: background-position .4s cubic-bezier(.3,1,.7,1);
}
JS:
// index.js
Page({
data: {
bg: "0"
},
onClick: function(){
if(this.data.bg==0){
this.setData({
bg: "60px"
})
}else{
this.setData({
bg: "0"
})
}
}
})
请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。
补充:Webview下没有这个问题,仅Skyline有此问题。