javascript - Using jquery to slide automatically depending on different ids -
i have 2 dots different ids. each id associated images. if click dot, images changed. now, want add slide within 5 minutes change dot dot using auto click function of jquery. tried creating many times couldn't it. please me kindly.
$(document).ready(function(){ $('#dot1,#dot2').click(function(){ var id = this.id; console.log("id is->",id); if(id=="#dot1"){ $("#dot1").hasclass('current'); settimeout(function() { $('#dot2').trigger('click'); }, 4e3); } if(id=="#dot2"){ $("#dot2").hasclass('current'); settimeout(function() { $('#dot1').trigger('click'); }, 4e3); } }); });
Comments
Post a Comment