• Empleos
  • Sobre nosotros
  • Empleos
    • Inicio
    • Empleos
    • Cursos y retos
  • Empresas
    • Inicio
    • Publicar vacante
    • Nuestro proceso
    • Precios
    • Evaluaciones
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

194
Vistas
¿Cómo aplicar colores para cada evento en el calendario completo js?

Quiero mostrar múltiples eventos con diferentes colores para cada uno. Aquí se han mostrado dos respuestas ajax en el calendario. Pero todos los eventos muestran solo verde. Los segundos eventos también visibles en color verde. ¿Cómo mostrar cada evento con diferentes colores?

Mi código es el siguiente:

 $('#calendar').fullCalendar({ events: function(start, end, timezone, callback) { $.ajax({ url: url1, dataType: 'json', success: function(response) { var events = []; $(response.data).each(function() { events.push({ title: $(this).attr('title'), start: $(this).attr('start'), // will be parsed color: 'green' }); }); callback(events); } }); $.ajax({ url: url2, dataType: 'json', success: function(response) { var events = []; $(response.data).each(function() { events.push({ title: $(this).attr('title'), start: $(this).attr('start'), // will be parsed color: 'red' }); }); callback(events); } }); } });
over 3 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recomiéndame algunas ofertas
Necesito ayuda