Support » Plugin: WP Accessibility Helper (WAH) » Resizing all fonts and other elements.

  • Resolved jmborromeo

    (@jmborromeo)


    Found a solution to resize all fonts and other elements.

    You simple need to create a new js script on your child theme and include it on your website.

    The following JS codes are similar function to add an attribute and control the elements sizes. Hope this helps.. Cheers

    jQuery(document).ready(function(){

    //FONT SIZE

    var resizable_elements = jQuery(“li,em,strong,i,blockquote,input,textarea”);

    resizable_elements.each(function(){

    jQuery(this).attr(‘data-wahfont’,parseInt(jQuery(this).css(‘font-size’)));

    });

    custom_font_resizer();

    });

    function custom_font_resizer(){

    var resizable_elements = jQuery(“li,em,strong,i,blockquote,input,textarea,select”);

    //Font++

    jQuery(“.font_resizer .larger”).click(function(e){

    e.preventDefault();

    resizable_elements.each(function(){

    var el_font_size = parseInt(jQuery(this).css(‘font-size’));

    jQuery(this).css(‘font-size’,parseInt(el_font_size+1)+’px’);

    });

    });

    //Font–

    jQuery(“.font_resizer .smaller”).click(function(e){

    e.preventDefault();

    resizable_elements.each(function(){

    var el_font_size = parseInt(jQuery(this).css(‘font-size’));

    if(el_font_size > 12){

    jQuery(this).css(‘font-size’,parseInt(el_font_size-1)+’px’);

    }

    });

    });

    //Font reset

    jQuery(“.wah-font-reset”).click(function(e){

    e.preventDefault();

    resizable_elements.each(function(){

    var el_font_size = parseInt(jQuery(this).css(‘font-size’));

    jQuery(this).css(‘font-size’,parseInt(jQuery(this).data(“wahfont”))+’px’);

    });

    });

    }

  • You must be logged in to reply to this topic.