Safari pauses all animation on redirect / form submission

前端 未结 5 2100
野性不改
野性不改 2021-02-01 18:08

I have an animation that triggers when a link is clicked. It is a jQuery animation that enlarges a div then fades out. To ensure speed, at the exact same time that the link is c

5条回答
  •  忘了有多久
    2021-02-01 19:09

    Safari complains that it can't find the variable someData, it is trying to set the value of the input to the value of a variable that does not exist and stops executing that portion of the page's JavaScript.

    [Error] ReferenceError: Can't find variable: someData
    

    Just create the variable like this:

    // [snip]
    var input = $("");
    var someData;
    input.val(someData);
    // [snip]
    

    and it will work in Safari.

提交回复
热议问题