HTML5 doctype and my smoothscrolling doesn't work anymore !

HTML5 doctype and my smoothscrolling doesn't work anymore !

Hello,

For my vertical website, I used to code in HTML4 Transitional and put a little script in order to smoothscroll through anchors :

  1. $(document).ready(function(){
        $('a').click(function(){
        var id = $(this).attr('href');
        scrollTo(id);
        return false;
    });

      function scrollTo(target){
        if($(target).length>=1){
          width=$(target).offset().top-130;
        }
        $('body').animate({scrollTop:width}, 1000);
        return false;
      }
    });













All of this was working before I switch to HTML5. Now, even anchors displace doesn't work.

So what is the deal ? Thanks in advance !!