1

Possible Duplicate:
Unexpected token ILLEGAL in webkit

Ive been looking at this and cannot see a problem, it works in jfiddle - just not on the site!

<script type="text/javascript">
var fixed = false;

$(document).scroll(function() {
    if( $(this).scrollTop() > 200 ) {
        if( !fixed ) {
            fixed = true;
            $('#menu-scroll').css({position:'fixed', display:'block'});
        }
    } else {
        if( fixed ) {
            fixed = false;
            $('#menu-scroll').css({display:'none'});
        }
    }
});​
</script>

link to the site is http://mtro.es/7

Community
  • 1
  • 1
Oliver Whysall
  • 351
  • 1
  • 6
  • 17

1 Answers1

-1

Maybe there is no html element with id "menu-scroll". You check..

ganeshk
  • 5,583
  • 3
  • 27
  • 31
gsh
  • 11
  • 1
  • Syntax errors aren't thrown depending on whether elements do or do not exist; moreover, jQuery never throws errors in case elements do not exist. – pimvdb Aug 24 '12 at 20:50