If it's the lettering
function you want to test for, you can do so like this;
$(document).ready(function() {
var items = $(".cs-text-cut");
if (items.lettering) {
items.lettering('words');
}
});
Or, if you want to make absolutely sure items.lettering
is a function before attempting to call it, you can do this:
$(document).ready(function() {
var items = $(".cs-text-cut");
if (typeof items.lettering === "function") {
items.lettering('words');
}
});
Or, if you really don't control the environment so you don't really know if the lettering function call is going to work or not and might even throw an exception, you can just put an exception handler around it:
$(document).ready(function() {
try {
$(".cs-text-cut").lettering('words');
} catch(e) {
// handle an exception here if lettering doesn't exist or throws an exception
}
});