Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('.foto_editor').click(function(){
- var tipo = $('#categorias_editor').find('option').filter(':selected').attr('tipo');
- if (tipo == 1) {
- var img = $(this).attr('src');
- var img = img.split('&');
- $('#fundo_editor').css('background', 'url('+img[0]+'&tX=518&tY=488) no-repeat');
- }
- if (tipo == 2) {
- var img = $(this).attr('src');
- var img = img.split('&');
- $('#borda_editor').append('<img src="'+img[0]+'&tX=120" id="" border="0" alt="" class="arrastavel" status="Inativo" />');
- $('.arrastavel').click(function() {
- $('#borda_editor img').css('z-index', '90');
- var status = $(this).attr('status');
- alert(status);
- if (status == 'Inativo') {
- $(this).css('z-index', '101');
- $(this).css('border', '1px solid red');
- $('#fundo').css('display', 'block');
- $(this).attr('status', 'Ativo');
- $(this).draggable({
- containment: "#borda_editor",
- handle: "p"
- });
- } else {
- $(this).attr('status', 'Inativo');
- $(this).css('border', '0px');
- $('#fundo').css('display', 'none');
- $(this).draggable("destroy");
- }
- });
- }
- });
Add Comment
Please, Sign In to add comment