1

Please See the image for clear understanding of problem:

here.

There is focusout event on boxes. While typing in the box, if a user clicks on buttons the click does not work as focus out called immediately and button moves up a bit when focusout from the box. I just came to know in advance how to fire click event of buttons just after focusout. Here is sample code on focusout.

$(document).on("focusout", ".fn-enlargeTextarea", function(event) {
     var optionNumber = ($(this).attr('id').replace('1option','')).trim();
     $('#1option'+optionNumber+'_counter').remove();
     $(this).removeClass('textarea-height01').addClass('textarea-height02');     
});
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129

2 Answers2

0

You can stop propagation and then call click on button. I did this here

event.stopPagation();
Mohtisham Zubair
  • 723
  • 5
  • 15
0

You can trigger events using jquery. If you'd like to fire the click event of buttons just after focusout, add the following line:

$( "#targetElm" ).trigger( "click" );

inside your callback function that runs on focusout.