小编Dar*_*rkW的帖子

CSS margin-left过渡不起作用

我正在尝试从中心向左转换并降低图像的高度.高度转换工作正常,但边距只是传送到左侧而不是动画.

这是我的代码:

#logo_img {
    height: 55px;
    width: 55px;
    background-color: red;
    margin-left: auto;
    margin-right: auto;
    display: block;
    transition: all 1s ease-in-out;
}

#logo_img.tiny {
    height:45px;
    margin-left: 0;
}
Run Code Online (Sandbox Code Playgroud)

JS:

$('#logo_img').addClass('tiny');
Run Code Online (Sandbox Code Playgroud)

工作实例:http://jsfiddle.net/v0w6s3ms/1/

任何帮助?

css transition margin

14
推荐指数
2
解决办法
3万
查看次数

ElasticSearch - 追加到整数数组

我是ES的新手,但我已经掌握了它.它是一个非常强大的软件,但我不得不说文档确实缺乏并且有时令人困惑.

这是我的问题:我有一个整数数组,如下所示:

"hits_history" : [0,0]
Run Code Online (Sandbox Code Playgroud)

我想通过一个"update_by_query"呼吁追加到数组的整数,我搜索,发现这个链接:https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update.html 其中有这个例子:

POST test/type1/1/_update
{
    "script" : {
        "inline": "ctx._source.tags.add(params.tag)",
        "lang": "painless",
        "params" : {
            "tag" : "blue"
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

所以我试过了:

 curl -XPOST 'localhost:9200/example/example/_update_by_query?pretty' -H 'Content-Type: application/json' -d'
     {
       "script": {
         "inline": "ctx._source.hits_history.add(params.hits)",
         "params": {"hits": 0}
       },
       "query": {
        "match_all": {}
        }
     }
     '
Run Code Online (Sandbox Code Playgroud)

但它给了我这个错误:

 "ctx._source.hits_history.add(params.hits); ",
 "                                   ^---- HERE"
 "type" : "script_exception",
     "reason" : "runtime error",
     "caused_by" : {
       "type" : "illegal_argument_exception",
       "reason" : "Unable to find dynamic method [add] with [1] …
Run Code Online (Sandbox Code Playgroud)

arrays append elasticsearch

6
推荐指数
1
解决办法
1536
查看次数

标签 统计

append ×1

arrays ×1

css ×1

elasticsearch ×1

margin ×1

transition ×1