Want more features on Pastebin? Sign Up, it's FREE!
Guest

Reset an function after DOM

By: a guest on Jul 10th, 2012  |  syntax: JavaScript  |  size: 0.96 KB  |  views: 32  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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.             });
clone this paste RAW Paste Data