• tlvwebdevelopment

    (@tlvwebdevelopment)


    The live preview is not working for the fonts.

    The following fixes the bug

    Line 57
    preview_text = jQuery('#acfgfs-preview div').html();
    should read
    preview_text = jQuery('.acfgfs-preview div').text();

    Line 60
    jQuery('#acfgfs-preview div').html(preview_text)
    should read
    jQuery('.acfgfs-preview div').text(preview_text)

    Cheers,
    Dan

    https://ww.wp.xz.cn/plugins/acf-google-font-selector-field/

Viewing 1 replies (of 1 total)
  • Thread Starter tlvwebdevelopment

    (@tlvwebdevelopment)

    Actually, this is still proplematic with multiple font selectors on the same page

    this fixes it

    preview_text = container.find('.acfgfs-preview div').text();
      font = new_font.replace( ' ', '+' );
      container.find('.acfgfs-preview').html('<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=' + font + '"><div style="font-family:' + new_font + '"></div>');
      container.find('.acfgfs-preview div').text(preview_text);
Viewing 1 replies (of 1 total)

The topic ‘JavaScript error’ is closed to new replies.