小编Seb*_*a99的帖子

单击后将背景幻灯片作为药丸

当我点击我的按钮时,我正在尝试做一个小动画.

我希望背景向左和向右滑动以说明用户的选择.

这是我的试用版:JSFiddle

$(".test").click(function() {
  $(".test").removeClass('active');
  $(this).addClass('active');
})
Run Code Online (Sandbox Code Playgroud)
div{
  list-style-type: none;
}
div a {
  text-decoration: none;
}
#cont {
  background-color: white;
  width: 100%;
  padding: 2px;
  height: 40px;
  -webkit-border-radius: 20px;
  -moz-border-radius: 20px;
  border-radius: 20px;
}
.choice {
  float: left;
  margin-right: 1px;
}
.choice div{
  width: 100px;
  padding: 11px 16px;
  text-align: center;
  float: left;
  background: #ff3232;
  margin-left: 10px;
  transition: all 0.4s linear;
  -webkit-border-radius: 20px;
  -moz-border-radius: 20px;
  border-radius: 20px;
}
.choice .left {
  background: linear-gradient(to right, white 50%, #b7d4e1 50%);
  background-size: …
Run Code Online (Sandbox Code Playgroud)

html css css-transitions css-shapes

9
推荐指数
1
解决办法
246
查看次数

FCM - 使用 expo 向 iOS 设备发送通知(React native)

我无法向使用Expo.io创建的 iOS 应用程序发送推送通知。

没有关于如何做到这一点的明确文档,所以这里是我的试验和我所做的事情:

带有 APN 密钥的 firebase 项目

在以编程方式调用此端点之前,我尝试使用 POSTMAN 让它工作(就像我在 Android 上用了不到 1 小时所做的那样)

这就是我所说的:

方法:POST

网址: https: //fcm.googleapis.com/fcm/send

身体 :

{
  "to": "token (read about it at the end of the post",
  "priority": "high",
  "data": {
    "experienceId": "@expoAccount/projectSlug",
    "title": "Hello there",
    "message": "General kenobi",
    "content_available": true
  },
    "content_available": true
}
Run Code Online (Sandbox Code Playgroud)

我已经测试了很多不同的身体结构(带/不带“content_available”键或带“通知”对象......因为所有身体结构都与 迄今为止读过的所有 问题 或文档不同 …

push-notification ios firebase-cloud-messaging expo

5
推荐指数
1
解决办法
7371
查看次数

Select2 - 禁用用户输入选择

我正在尝试在 select2 选择中从 ajax 设置数据...

但问题是,如果我写的东西不在我的数据中,我可以选择这个选项!

在此处输入图片说明

这将取这个值“我不存在”...... formatNoMatches() 函数似乎没有被调用......

JS:

$(".select2-ajax").select2({
ajax: {
url: "ajax.call.php",
type:'POST',
dataType: 'json',
data: function (params) {
  return {
    nom: params.term, // search chars
    page: params.page,
  };
},
processResults: function (data, page) {
console.log(data.data);
if(typeof(data.data)=='undefined' || !data.data || data.data.length <= 0)
  var res = [];
else
{
  var res = [];
  for (var i = data.data.length - 1; i >= 0; i--) 
  {
    res.push({"text":data.data[i]["nom"]+' '+data.data[i]["prenom"],"id":data.data[i]["id_salarie"]});
  };
}
return { results: res};
},
cache: true
 }, …
Run Code Online (Sandbox Code Playgroud)

javascript jquery jquery-select2

2
推荐指数
1
解决办法
3994
查看次数