A recursive call, div active, but what is the cause of the error?

$(function(){
            $("input").click(function fn(){
                $("-sharpbox").animate({
                    left:"+=20px"
                })
                fn();
            })
        })

Mar.04,2021

  1. '+ = 20px' there is no problem with writing, and this is a common way of writing jQ Animate, and velocityJS is also this syntax (inherited from jQ)
  2. try to write like this:

      

    two bigwigs are right, stack overflow, your fn executed an unlimited number of times, memory can not stand, directly interrupt your operation, the syntax is also wrong, the write operation in the string is always the same string.

Menu