Conditional statement for carousel interval script

Help for a non-developer. Can someone help me with a conditional statement to run the carousel interval script on the homepage only (is_front_page)? And place it script in lib/scripts.php? Or, is there another appropriate way to do this?

$(document).ready(function() {
$(’.carousel’).carousel({
interval: 4000
})
});

Just edit _main.js and place it in the home init that’s already setup in there

Hi Ben, I’m a total newbie, what do I put in _main.js and do you mean init.php. How?

Put $('.carousel').carousel({ interval: 4000 }); on line 15 (where it says JS here under home page) and then run grunt.

great, but i’m not using grunt :frowning:

Copy the contents of the _main.js file Ben linked above into your /assets/js/main.js file, then make the changes he suggests.

Then go learn why grunt is awesome and start using it.

Thanks Chris! You guys rock. Grunt is on my priority to-learn list.