小编Joh*_*mas的帖子

使用jQuery关闭CSS3动画?

我有一个加载页面时有动画的对象:

.logo-mark {
        -webkit-animation: spin 2s 1 cubic-bezier(0.000, 0.000, 0.230, 1.000);
            -moz-animation: spin 2s 1 cubic-bezier(0.000, 0.000, 0.230, 1.000);
            -ms-animation: spin 2s 1 cubic-bezier(0.000, 0.000, 0.230, 1.000);
            animation: spin 2s 1 cubic-bezier(0.000, 0.000, 0.230, 1.000);
    }
Run Code Online (Sandbox Code Playgroud)

在某个时间,我希望JavaScript打开一个无休止地发生的特定动画,直到JavaScript停止所述动画.所以我只创建了另一个名为.logo-load的类,并且在某些时候,jQuery执行了一个addClass和一个removeClass.

.logo-loading {
            -webkit-animation: spin 4s infinite linear;
                -moz-animation: spin 4s infinite linear;
                -ms-animation: spin 4s infinite linear;
                animation: spin 4s infinite linear;
        }
Run Code Online (Sandbox Code Playgroud)

但是,当JavaScript删除类时,无论如何,对象都会保持旋转.我能在这做什么吗?

javascript jquery animation css3

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

如何根据React中的javascript对象渲染组件X次?

我正在尝试渲染X张照片,具体取决于拍摄时间OBJECT (photos).我试过将数据附加到字符串但它不起作用.好的解决方案?

var RenderPhotos = React.createClass({
  getInitialState: function() {
      return {
        photos: this.props.photos
      };
  },
  render: function(){
    var photoHolder = "";
    for(var i=0;i<this.props.photos.length;i++){
      photoHolder += ("<View>
        <Text>" { this.props.photos[0].description } "</Text>
      </View>");
    }

    return (
      { photoHolder }
      // <View>
      //   <Text> { this.props.photos[0].description } </Text>
      // </View>
    )
  }
});
Run Code Online (Sandbox Code Playgroud)

javascript reactjs

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

在JavaScript中无法创建多个if条件?

我完全不知道为什么这不起作用.对我毫无意义.

这将返回"语法错误:解析错误":

if ($(this).attr("id") === 'search' || opening = true) return false;
Run Code Online (Sandbox Code Playgroud)

为了更好的衡量,我也尝试了以下,产生了相同的结果:

if (1 = 1 && 2 = 2) { return false; }
Run Code Online (Sandbox Code Playgroud)

javascript if-statement

0
推荐指数
2
解决办法
900
查看次数

标签 统计

javascript ×3

animation ×1

css3 ×1

if-statement ×1

jquery ×1

reactjs ×1