I have made a prototype styled function in jQuery, example:
// Check if $Example's width/height is completely in a container:
$('#Example').elementWithinBounderiesOf( $('#Container') );
Within these functions, I can use this
or $(this)
as the object we called the function on, I understand and get this, but:
How do we name/call/label/refer-to the element on which we called the function on
?
I need this for documentation purposes:
// elementWithinBounderiesOf($container) - Check if [NAME NEEDED] fits within $container
// Input: [NAME NEEDED] - the object we're gonna check if it fits in $container
// $container - the container which should contain the [NAME NEEDED]
// Output: Boolean true/false wether or not the [NAME NEEDED] fits within $container
$.fn.elementWithinBounderiesOf = function ($container) {
// $(this) is in this example $('#Example'), but could be any other object
// How do we call this selected object *here, within the function*?
// The name for object-on-which-we-activated-the-function (but that's quite a long name)
}
Note 1: This is an example, I do not need a name specific for this case.
Note 2: I do not need to know how to pass a variable in the function, or a reference, or whatever-functionallity, I'm only looking for that name for object on which the function is activated