Advertisement
Guest User

Reset an function after DOM

a guest
Jul 10th, 2012
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $(document).bind('teste', function(e, elemento) {
  2. // Data content recovered from the iframe click
  3.                 var title = $(elemento).data('title');
  4.                 var photo = $(elemento).data('photo');
  5.                 var id = $(elemento).data('id');
  6.                 var price = $(elemento).data('price');
  7.  
  8.                 totalEconomizado = totalEconomizado + price;
  9.                 $("#desconto_total").html(totalEconomizado);
  10. // Append event with the delete <a> element
  11.                 $("#listaPedidos").append('<li data-price="' + price + '" id="' + id + '"><a href="javascript:;" class="deletar_produto_descontometro"></a><img src="' + photo + '" width="40" height="40" title="' + title + '"/></li>');
  12. // fancybox plugin to show iframe its closed
  13.                 $.fancybox.close();
  14. // <a> delete button event to remove
  15. $(".deletar_produto_descontometro").click(function() {
  16.  var    li_clicked = $(this).parent('li');
  17.  li_clicked.remove();
  18. });
  19.             });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement