executing a click function without the user clicking?
问题 $(function() { setInterval( "clickRight()", 5000 ); }); $('.slide_right').click(function clickRight(){ etc... I basically want my slideshow to move to the next slide as if the user clicked the right button. This example is not working for me. 回答1: setInterval( "clickRight()", 5000 ); function clickRight() { $('.slide_right').trigger('click'); }; 回答2: $('.slide_right').trigger('click'); or $('.slide_right').click(); 回答3: You can trigger an event $("element").trigger("event"); Bind the event to