Cufon color stays the same after class deletion

I have links, and when you click, an identifier is added that changes color. Other links remove the class, so the color will be redirected to normal mode. This works with javascript disabled, and I even see code working in firebug, but for some reason cufon saves the selected class. Any help please. That

+3
source share
2 answers

Try redrawing the text.

Cufon.refresh();
+1
source

In response to what balint said, here is a jquery example on how to update cufon for list items that switch classes:

$("ul li").click(function(){
    var me = $(this)
    me
        .addClass('active')
        .siblings().removeClass('active')

    // Need to call the function twice for some reason
    Cufon.replace(me);
    Cufon.replace(me.siblings());
})
+1
source

Source: https://habr.com/ru/post/1776501/


All Articles