I have made some Jquery that you can see with this fiddle below: 
<http://madaxedesign.co.uk/dev/Test/>
<http://jsfiddle.net/x82mU/1/>

Code: 

```
$(document).ready(function() {
var $root = $('html, body ');
$('.scroll a').click(function(e) {
    var href = $.attr(this, 'href');
    $root.animate({
        scrollTop: $(href).offset().top
    }, 500, function () {
        window.location.hash = href;
    });
    return false;
});

// Responsive menu 
$(function() {
    var pull        = $('#pull'),
        menu        = $('nav ul'),
        menuHeight  = menu.height()

    $(pull).on('click', function(e) {
        e.preventDefault();
        menu.slideToggle();
    });

    $(window).resize(function(){
        var w = $(window).width();
        if(w > 320 && menu.is(':hidden')) {
            menu.removeAttr('style');
        }
    });
}); 
 });

```

But it pulls through with this error: 
Uncaught TypeError: Cannot read property 'top' of undefined 

This is preventing my next piece of Jquery to work. 

I was wondering if anyone could let me know why, or give me a solution?

Many Thanks