var temp_color = ""; ( function( $ ) { wp.customize( 'artmag_accent_color', function( value ) { value.bind( function( newval ) { temp_color = newval; $('.yel').css('color', newval ); $('.post .post-body').css('background', newval); $('#header ul a').hover(function(){ $(this).css('background', newval); },function(){ $(this).css('background', ""); } ); $('#bottom-nav a').hover(function(){ $(this).css('color', newval); },function(){ $(this).css('color', ""); } ); } ); } ); } )( jQuery ); ( function( $ ) { wp.customize( 'artmag_accent_letters', function( value ) { value.bind( function( newval ) { var content_h2 = [].slice.call(document.getElementsByClassName('content-head'),0); content_h2.forEach(function(item){ item.innerHTML = item.innerHTML.replace(/(<([^>]+)>)/ig,""); var letters = [newval, "art"]; accentLetters(letters); if (temp_color !== "") $('.yel').css('color', temp_color); }); } ); } ); } )( jQuery );