Hey all I have a jQuery function like so:
$.fn.sexyForm = function (style){
$('.sexyform').on('click',function(){
$(this).find('input').trigger('focus');
});
var $input = $('.sexyform');
****************************************************
************* MORE CODE HERE TAKEN OUT *************
****************************************************
function closeBox(element) {
//console.log("Closing", element);
//Get the element that needs to be closed
var $el = $(element);
//Grab the data we set on it
var originalData = $el.data('original-styles');
//console.log(originalData);
var style = $el.data('style');
//Reset the input
$el.find('input').animate({
left: originalData.startPosInput
})
$el.find('span').animate({
width: originalData.startWidth,
left: originalData.startPosPlace,
})
}
};
And I am trying to call that from another location like this:
function clearAll() {
console.log('hi');
$('.input3').val('');
$('.input3').removeClass('form-open');
closeBox($('.input3'));
$("span[data-id*='txt']").each(function(index) {
//enable ALL textboxes
$(this).css("pointer-events", "auto");
$(this).fadeTo("fast", 1.0);
$('#searchTop').text('above');
});
$('#schoolSelect').prop('selectedIndex', 0).selectric('refresh');
$('#roles').prop('selectedIndex', 0).selectric('refresh');
$('#clearBtn').focus();
}
The error comes from the closeBox($('.input3'));. I have tried doing the following:
$.fn.sexyForm.closeBox($('.input3'));
and that doesn't work as well. What am I missing?