Я передавал в функцию сам id элемента
animation( moon, 3, 20, 40 );
function animation( elem, speed, delay, distance ) {}
The value reported by .height() is not guaranteed to be accurate when the element or its parent is hidden. To get an accurate value, ensure the element is visible before using .height(). jQuery will attempt to temporarily show and then re-hide an element in order to measure its dimensions, but this is unreliable and (even when accurate) can significantly impact page performance. This show-and-rehide measurement feature may be removed in a future version of jQuery.
Разве это не очевидно из регулярного выражения??
telephoneCheck("555-555-5555"); // true
никак не намекают на то, что они неправильные, там true справа написано.