jQuery:试图让动画每3秒发生一次,不起作用?

时间:2016-05-02 00:17:00

标签: javascript jquery

JS:

public void ReadFile(String inputfile) throws FileNotFoundException {
    arraylist = new ArrayList<Student>();
    File myFile = new File(inputfile);
    Scanner sc = new Scanner(myFile);

    while (sc.hasNextLine()) {
        try {
            String[] line = sc.nextLine().split(" ");

            arraylist.add(new Student(line[1], line[0], Integer.parseInt(line[2]), ...));
        } catch (Exception e) {
            System.out.println("Error of some kind...");
            continue; // maybe, I dunno.
        }
    }
}

shuriken 是一张图片。它只发生一次..为什么这不起作用?

1 个答案:

答案 0 :(得分:2)

最好使用toggleClass()

$("#gifttwo").on("click", function() {
  setInterval(function() {
    $("#shuriken").toggleClass("animated wobble");
  }, 3000);
});