Proxy Simple

ejemplo funcion proxy, simple

by Juan Muñoz

HTML

<div class='botones'>boton1</div>
<div class='botones'>boton2</div>
<div class='botones'>boton3</div>

CSS

div{
  display: block;
  margin-top:3em;
}

JavaScript

$(document).ready(function (){


	$(document).on('click', '.botones', function (){
  	var elemento = $(this);
    setTimeout($.proxy(function (){
    	
      $(this).hide();
      console.log("si funciona"+elemento.text())
      }, elemento ) , 1000 )
    
  })


})