Yeah, $ is the jquery short function name, which is disabled on WordPress to prevent conflicts. You’d either need to replace $ with jQuery as the function name, or wrap everything is the function below:

jQuery(function ($) {
/* You can safely use $ in this code block to reference jQuery */
});