ui_search_one.js 516 B

1234567891011121314151617
  1. +function ($) {
  2. $.fn.formFocus = function (){
  3. var $this = $(this);
  4. if($this.attr('data-form')=="clear"){
  5. var $clear = $('<div class="input-clear"><span class="close"></span></div>').appendTo($this.parents('.c-ser-main'));
  6. $this.on('blur',function(){
  7. setTimeout(function(){$clear.remove();},200)
  8. });
  9. $clear.on('click',function(){
  10. $this.val('').focus();
  11. })
  12. }
  13. }
  14. $(document).on('focus','input[data-form="focus"],input[data-form="clear"]',function(){
  15. $(this).formFocus();
  16. })
  17. }(jQuery);