What't the point of writing jquery functions like this:
(function( $ ) {
$.fn.simple_hide_function = function() {
var $t = this;
$t.hide();
};
})( jQuery );
$(window).load(function () {
$('#myId').simple_hide_function();
});
Why not do it like this:
function simple_hide_function(id){
id.hide();
};
$(window).load(function () {
var my_id = $('#my_id');
simple_hide_function(my_id);
});
Added question:
Would it be any problem doing this?
function simple_hide_function(id){
id.hide();
};
$(window).load(function () {
var my_id1 = $('#my_id1'),
my_id2 = $('#my_id2'),
my_id3 = $('#my_id3');
simple_hide_function(my_id1);
simple_hide_function(my_id2);
simple_hide_function(my_id3);
});