I have a link:

```
<a href="#cat2" class="scrollto">Cat 2</a>

```

and an anchor:

```
<a name="cat2"></a>

```

this is my js

```
      $(document).ready(function () {
          $('.scrollto').click(function () {
              var aTag = $(this).attr('href');
              $('html,body').animate({
                  scrollTop: aTag.offset().top
              }, 600);
              return false;
          });
      });

```

could someone pls help me fix this problem?