// Coupon Env $( 'div.woocommerce' ).on( 'click', '.coupon-env .coupon-enter', function( ev ) { ev.preventDefault(); var $couponEnv = $( this ).parent(), $input = $couponEnv.find('.form-control'); $couponEnv.addClass('coupon-visible'); setTimeout(function(){ $input.focus(); }, 200); } ).on( 'click', '.coupon-env .close-coupon', function( ev ) { ev.preventDefault(); $( this ).closest( '.coupon-env' ).removeClass('coupon-visible'); } );
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter