此代码在我的页面中没有错误,因此我不在那里寻求任何帮助。我只是好奇是否有更短的方法可以做到这一点,有很多代码被重复,每次只更改一些类名。我可以在某种函数或循环中缩短它吗?谢谢
//menu
$('.aboutOne').click(function(){
$.scrollTo('.basicsRow', 1000, {axis:'yx'});
$.scrollTo('.basicsRow', 1000, {axis:'xy'});
})
$('.aboutTwo').click(function(){
$.scrollTo('.storyRow', 1000, {axis:'yx'});
$.scrollTo('.storyRow', 1000, {axis:'xy'});
})
$('.aboutThree').click(function(){
$.scrollTo('.teamRow', 1000, {axis:'yx'});
$.scrollTo('.teamRow', 1000, {axis:'xy'});
})
$('.aboutOne').click(function(){
$.scrollTo('.basicsRow', 1000, {axis:'yx'});
$.scrollTo('.basicsRow', 1000, {axis:'xy'});
})
$('.aboutTwo').click(function(){
$.scrollTo('.storyRow', 1000, {axis:'yx'});
$.scrollTo('.storyRow', 1000, {axis:'xy'});
})
$('.aboutThree').click(function(){
$.scrollTo('.teamRow', 1000, {axis:'yx'});
$.scrollTo('.teamRow', 1000, {axis:'xy'});
})
$('.titleOne').click(function(){
$.scrollTo('.homeRow', 1000, {axis:'yx'});
$.scrollTo('.homeRow', 1000, {axis:'xy'});
})
$('.docsOne').click(function(){
$.scrollTo('.startRow', 1000, {axis:'yx'});
$.scrollTo('.startRow', 1000, {axis:'xy'});
})
$('.docsTwo').click(function(){
$.scrollTo('.pinpointRow', 1000, {axis:'yx'});
$.scrollTo('.pinpointRow', 1000, {axis:'xy'});
})
$('.docsThree').click(function(){
$.scrollTo('.swipeRow', 1000, {axis:'yx'});
$.scrollTo('.swipeRow', 1000, {axis:'xy'});
})
$('.docsFour').click(function(){
$.scrollTo('.restRow', 1000, {axis:'yx'});
$.scrollTo('.restRow', 1000, {axis:'xy'});
})
$('.docsFive').click(function(){
$.scrollTo('.actionRow', 1000, {axis:'yx'});
$.scrollTo('.actionRow', 1000, {axis:'xy'});
})
$('.contactOne').click(function(){
$.scrollTo('.contactRow', 1000, {axis:'yx'});
$.scrollTo('.contactRow', 1000, {axis:'xy'});
})
$('.downloadOne').click(function(){
$.scrollTo('.downloadRow', 1000, {axis:'yx'});
$.scrollTo('.downloadRow', 1000, {axis:'xy'});
})