Skip to content

Instantly share code, notes, and snippets.

@ricardofiorani
Created May 27, 2014 14:24
Show Gist options
  • Save ricardofiorani/787881c2ed7c314d9ffd to your computer and use it in GitHub Desktop.
Save ricardofiorani/787881c2ed7c314d9ffd to your computer and use it in GitHub Desktop.
COnCÔn
$(document).ready(function(){
// Quando descrição tem muito caracter
$(".compare .atributo").each(function(){
if ( $(this).html().length > 30 ){
$(this).addClass("char-G");
}
});
// Ajax Select 2 quando seleciona uma maquina para comparar
$('.compare select').change(function(){
$(this).parent().parent().parent().parent().addClass($(this).attr('id')+'sel');
$(this).parent().parent().parent().addClass("menor");
var idSelect = $(this).attr('id') + "sel";
var nomeMaquina = this.value;
$.ajax({
url: "inc_item-comparacao.php",
beforeSend: function ( ) {
$(this).parent().parent().hide();
$.fancybox.showLoading();
}
}).done(function ( data ) {
$('.' + idSelect + ' .recebe-item').html(data);
$('.' + idSelect + ' .recebe-item').fadeIn(500);
$.fancybox.hideLoading();
})
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment