couldn't find a specific answer.
If I create a jQuery function, call it "doMobile" per say, and I want it to use a function inside of it if so, what do I do?
This is what I am trying to do:
$.fn.doMobile = function(somefunctioninside) {
if ( $('.mobile').is(':visible') )
somefunctioninside();
};
$('.menu').doMobile(function() {
$(this).css('background-color', 'red');
});
When I it like that though, $(this) - $('.menu) doesn't becomes red.