この関数を別の div に複製するにはどうすればよいですか?
function goto(id, t){
//animate to the div id.
$(".headbox-wrapper").animate({"left": -($(id).position().left)}, 600);
// remove "active" class from all links inside #nav
$('#nav a').removeClass('active');
// add active class to the current link
$(t).addClass('active');
}
新しい名前と新しい div、例 function2 を使用します。
これと同じページにありますが、新しいスクリプトをコピーして印刷すると、どちらも機能しません。