where does $(this) point to , under the following circumstances .

where does $(this) point to , under the following circumstances .

Given the following code INSIDE A PLUGIN , where exactly is $(this) pointing to ??

EXMPLE ONE : 

var current = $(this); // declared as a global variable inside a plugin. EXAMPLE TWO 

  1. function number_of_image(){
  2. $(current).each(function(){
  3. count++;
  4. });
  5. return count;
  6. };
EXAMPLE TWO : 

  1.   function number_of_image(){
  2.  $(this).each(function(){
  3. count++;

  4. });

  5. return count;
  6. };
 
EXAMPLE THREE : (This is not a function , this snippet of code is typed in the global scope of the plugin) : 

  1.              var count = 0;
  2. $(this).each(function(){
  3. count++;
  4. });

now given that i call the plugin this way : 

  1. $('img').pluginname();
what does the $(this) point to ? (i actually want $(this) to point to the current selected element , which in this case is $('img')). 

Thank you . 


Gautam .