Smooth-scroll and Modernizr

The smooth-scroll js plug-in we have been using has a small issue with Modernizr. To make it work with Morenzr, you need to include new event, and include the $(document).ready function inside of it. The original answer can be found here. This is a sample code:

<script src="../js/modernizr.custom.29859.js"></script>

<script>
Modernizr.load([
{
load: [
‘../js/jquery-1.10.2.min.js’,
‘../js/toggle.js’,
‘../js/jquery.smooth-scroll.min.js’
],
complete:
        function(){
            $(document).ready(function(){
                $(‘li.pagenav a’).smoothScroll();
            });
  }
},
{
     // test for media query support, if not load respond.js
test : Modernizr.mq(‘only all’),
// If not, load the respond.js file
nope : ‘../js/respond.min.js’
}
]);
</script>