function init(elem, options){ if(0 != elem.children().length){return;}.... you need this code
function init(elem, options){
if(0 != elem.children().length){return;}....
you need this code