When a function is called repeatedly, DOM will bind JS to listen for the event again, so the event will be repeated and the execution effect will be affected. It would be nice to remove the event before binding it.
//bottom_button is the parent tag class, Class $('.bottom_button').off('click','.changemode '). On ('click','.changemode ',function() { changeMode(); });Copy the code