如何仅使用CSS在5秒后隐藏背景图片?

时间:2018-11-09 11:49:36

标签: javascript css3 css-transitions

我正在使用数组值,它们应显示在div中。在这个div中,我要在跨度中添加背景图像。我的问题是我只想使用CSS在5秒后隐藏背景图片。我正在使用一些不隐藏背景图像的方法。这是我的代码,

MY_Controller

脚本文件是

<div id='remove_elem' data-bind='template: { foreach: showRacer }'>
    <div style="width: 50%;" data-bind='attr: { "class": "planet "}'>
        <span data-bind='attr: {"id": id }' class="downImg"></span>
        <div class="left" data-bind='text: id'></div>
        <div class="right" data-bind='text: rank'></div>
    </div>
</div>

css样式为

   $(document).ready(function(){ 
    var PlanetsModel = function() {
        self.Racer = ko.observableArray([
            { id: "Racer-101", rank: "5"},
            { id: "Racer-102", rank: "2"},
            { id: "Racer-103", rank: "1"},
            { id: "Racer-104", rank: "4"},
            { id: "Racer-105", rank: "7"},
            { id: "Racer-106", rank: "8"},
            { id: "Racer-107", rank: "9"},
            { id: "Racer-108", rank: "3"},
            { id: "Racer-109", rank: "6"}
        ]);

       //var newData = self.Racer();
        console.log("First array : " + JSON.stringify(self.Racer()));


        this.showRacer = ko.computed(function() {
           return self.Racer();        
        }, this);
    };
ko.applyBindings(new PlanetsModel());
});

这是我的示例代码,它们应该显示图像,但2秒后不隐藏图像。在css中怎么可能..

0 个答案:

没有答案