Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

325
Vistas
Is it possible change favicon on site when users change themes?

I have two themes on my site: Red, and Blue. This works fine.

I must know if I can make something to change the favicon, when users change the theme.

I know this code is for implementing favicon:

<link rel="shortcut icon" href="favicon.ico" />
<link rel="icon" href="favicon.ico" />

What do I need to make this possible? Using jQuery?


I have this script which I use for changing themes:

$("#painel_faccao li a").click(function() { 
        $("link#faccao").attr("href",$(this).attr('rel'));      
        $.cookie("css",$(this).attr('rel'), {expires: 365, path: '/'});
     return false;
     
  });

How I can implement this here?

(This question has a more modern approach to this function)

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

There is an answer on here on Stack Overflow: Changing website favicon dynamically

I like this answer best:

If you have the following HTML snippet:

<link id="favicon" rel="shortcut icon" type="image/png" href="favicon.png" />

You can change the favicon using Javascript by changing the HREF element on this link, for instance (assuming you're using JQuery):

$("#favicon").attr("href","favicon2.png");

Just use JQuery to check the stylesheet and change the favicon based on it.

over 4 years ago · Santiago Trujillo Denunciar

0

Yeah, there is another way. Just do it

  1. Remove <link rel="shortcut icon" ...>
  2. Add the code below
$(window).load(function () {
    $('head').append('<link href="your_favicon_name.ico" rel="shortcut icon" type="image/x-icon" />');
  });
over 4 years ago · Santiago Trujillo Denunciar
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 Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda