Button on Wordpress customizer is not responding on click event -
i have custom button control wordpress customizer.i trying click event nothing happen after click.
button code:
<button type="button" id="clickme" class="button customize-theme">reset</button>
my .js flie
( function( $ ) {$(document).ready(function(){$("#clickme").click(function({alert("i clicked");});});} )( jquery );
actually trying give alert ok , cancel button.if user says ok run below function.
function reset_mytheme_options() { remove_theme_mods();}
the widgets in customizer dynamically added. can use domnodeinserted event access these dynamically created elements.
jquery(document).ready(function($) { $( '#widgets-right' ).delegate( '#customize-theme-controls', 'domnodeinserted', function( ev ) { $( "#clickme" ).click( function() { console.log("i clicked"); }); } });
Comments
Post a Comment