I have a Carousel made from bootstrap and this is the script to run it.

```
<script>
    !function ($) 
    {
        $(function()
        {
            $('#myCarousel').carousel()
        })
    }(window.jQuery)
</script>

```

I tried adding a different effect on the navigation bars I got so that when I click the navigation, it will slide up into the section in that page. I added this script.

```
<script>
    $('a').click(function()
    {
        $('html, body').animate(
        {
            scrollTop: $( $(this).attr('href') ).offset().top
        }, 500);
        return false;
    });
</script>

```

when I added the script, the left and right buttons in the carousel stopped working. I really don't know if it had a conflict with the second script. I spent around half an hour looking for the error and finally found out that the second script conflicted with the carousel script.
Is there an error in the scripts? How do I fix it?