Guest User

Untitled

a guest
Apr 20th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.17 KB | None | 0 0
  1. $('.foto_editor').click(function(){
  2.             var tipo = $('#categorias_editor').find('option').filter(':selected').attr('tipo');
  3.             if (tipo == 1) {
  4.                 var img = $(this).attr('src');
  5.                 var img = img.split('&');
  6.                 $('#fundo_editor').css('background', 'url('+img[0]+'&tX=518&tY=488) no-repeat');
  7.             }
  8.            
  9.             if (tipo == 2) {
  10.                 var img      = $(this).attr('src');
  11.                 var img      = img.split('&');
  12.                 $('#borda_editor').append('<img src="'+img[0]+'&tX=120" id="" border="0" alt="" class="arrastavel" status="Inativo" />');
  13.                 $('.arrastavel').click(function() {
  14.                     $('#borda_editor img').css('z-index', '90');
  15.                     var status = $(this).attr('status');
  16.                     alert(status);
  17.                     if (status == 'Inativo') {
  18.                         $(this).css('z-index', '101');
  19.                         $(this).css('border', '1px solid red');
  20.                         $('#fundo').css('display', 'block');
  21.                         $(this).attr('status', 'Ativo');
  22.                         $(this).draggable({
  23.                             containment:    "#borda_editor",
  24.                             handle:         "p"
  25.                         });
  26.                     } else {
  27.                         $(this).attr('status', 'Inativo');
  28.                         $(this).css('border', '0px');
  29.                         $('#fundo').css('display', 'none');
  30.                         $(this).draggable("destroy");
  31.                     }
  32.                 });
  33.             }
  34.         });
Add Comment
Please, Sign In to add comment