after trying several ways of (first time) creating an extension to jQuery... and it doesn't work yet:
(function($){
$.fn.fixInputWidthsForBlog = function()
{
console.log('hi extension');
// var w = $('#newblogentryform input[name="headline"]').outerWidth();
// $('#newblogentryform textarea[name="text"]').outerWidth(w);
// $('#newblogentryform submit[name="submit"]').outerWidth(w);
}; // endFUNC
}(jQuery));
this (following) is where i get an error:
"jquery-3.1.0.min.js:2 Uncaught TypeError: $.fixInputWidthsForBlog is not a function"
$(document).ready(function(){
$.fixInputWidthsForBlog();
alert('ok1');
$(window).on('resize', function(){ $.fixInputWidthsForBlog(); });
$('.linkNewBlogEntry').on('click',function() {
$('#newblogentryformdiv').slideToggle().delay(1200).fixInputWidthsForBlog();
// setTimeout("fixInputWidthsForBlog();",1200);
return false;
});
});
I also tried:
$.fn.extend({
fixInputWidthsForBlog = function() {}
});
and simply:
$.fn.fixInputWidthsForBlog = function() {};
but all of them result in this very same error:
"jquery-3.1.0.min.js:2 Uncaught TypeError: $.fixInputWidthsForBlog is not a function"
in the line where I try to execute:
$.fixInputWidthsForBlog();
in one way or another.