So, I've a menu that scroll with my site when certain point.
But also I want stopt it when my site has 768px width.

I try this way

```
$(window).scroll(function() {
 if ($(window).width() < 760)
     {
        $('#menu').css({'position' : 'absolute'});
     }
 });

```

And that way either:

```
$(function() {
if ( $(window).width() < 760) {     
  $('#menu').css({'position' : 'relative'});
}
});

```

Fail in both attempts. But making improvements any of them serves?

Maybe this help. This is the code that turn my menu scroll.

```
$(function() {
$(window).scroll(function()
{
var topo = $('#topo').height(); // altura do topo
var rodape = $('#rodape').height(); // altura do rodape
var scrollTop = $(window).scrollTop(); // qto foi rolado a barra
var tamPagina = $(document).height(); // altura da p?gina

if(scrollTop > topo){
  $('#menu').css({'position' : 'fixed', 'top' : '0'});
}else{
  $('#menu').css({'position' : 'relative', 'margin-top' : 0});
}
});
});

```