Support » Plugin: Ajax Search Lite » Add focus

  • Resolved doomidze

    (@doomidze)


    Hello guys. Thank you good plugin. I’m in trouble. Can’t add class “focused” on search wrapper via jquery. When I’m clicking on input – I always receiving two clicks.
    For example:
    $(‘#ajaxsearchlite1 .probox .proinput input.orig’).on(“focus”, function(){
    console.log(‘focus element’);
    var elem = $( ‘#ajaxsearchlite1’ );
    elem.toggleClass( “focused” );
    });

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author wpdreams

    (@wpdreams)

    Hi,

    I rather recommend using the focus and the blur events instead, such as:

    jQuery(function($)
      $('.asl_m input.orig').on('focus', function(){
        $(this).addClass('focused');
      });
      $('.asl_m input.orig').on('blur', function(){
        $(this).removeClass('focused');
      });
    });

    Best regards,
    Ernest M.

    Thank you, it works. Сlass, not id.
    .asl_m input.orig

    Plugin Author wpdreams

    (@wpdreams)

    You are welcome! You are right, I corrected it.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Add focus’ is closed to new replies.