$('body').on('click',$("#id1"),function(){ $('html body').animation({ scrollTop: $("#id1").offset().top },0)})$('body').on('click',$("#id2"),function(){ $('html body').animation({ scrollTop: $("#id2").offset().top },0)})id選擇器都是同一個button類型的,如果有多個button,優(yōu)雅的寫法應(yīng)該怎么寫
求事件委托的優(yōu)雅寫法
ibeautiful
2018-10-19 14:11:36