Forum Replies Created

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

    (@oddcomments)

    I ended up getting the answer at stackoverflow. If anyone runs into this, the answer is to wrap it in an if ($(window).width() < 768). The modified code is as follows:

    if ($(window).width() < 768) {
    	wp.customize( 'background_color', function( value ) {
    		value.bind( function( newval ) {
    			$('nav').css('background-color', newval );
    		} );
    	} );
    }

    One flaw, however, is that it doesn’t work if you start larger and resize. The response to that was to use $(window).trigger('resize'); and load it on $(document).ready(function() { $(window).trigger('resize'); });

Viewing 1 replies (of 1 total)