Here is my fiddle link.

这是我的小提琴链接。

jQuery('input').focusin(function(){
  window.setTimeout(function() {
    jQuery('input').addClass('animatedBottomBorder');
  }, 150);
  window.setTimeout(function() {
    jQuery('input').addClass('animatedLeftBorder');
  }, 300);
  window.setTimeout(function() {
    jQuery('input').addClass('animatedTopBorder');
  }, 450);
  window.setTimeout(function() {
    jQuery('input').addClass('animatedRightBorder');
  }, 600);
});
jQuery('input').focusout(function(){
    jQuery('.searchTextField').removeClass('animatedBottomBorder');
    jQuery('.searchTextField').removeClass('animatedLeftBorder');
    jQuery('.searchTextField').removeClass('animatedTopBorder');
    jQuery('.searchTextField').removeClass('animatedRightBorder');
});

In focusin event, borders start to fadein and in focusout event borders disappear.

在focusin事件中,边框开始淡化并且焦点在事件边界消失。

But the line should look like building up while moving and quite fast. Now it loads in a fade in motion but I want it to be in a moving motion.

但这条线看起来应该像移动时一样快速地建立起来。现在它加载了一个淡入淡出的运动,但我希望它处于一个移动的运动中。

1 个解决方案

#1


0

Please try the below code:

请尝试以下代码:

jQuery('input').focusin(function(){
  window.setTimeout(function() {
    jQuery('input').css({"border-right-color": 'blue'}).animate({
        borderWidth: 4
    }, 500, 'swing');
  }, 150);
  window.setTimeout(function() {
    jQuery('input').css({"border-bottom-color": 'green'}).animate({
        borderWidth: 4
    }, 500, 'swing');
  }, 300);
  window.setTimeout(function() {
    jQuery('input').css({"border-left-color": 'black'}).animate({
        borderWidth: 4
    }, 500, 'swing');
  }, 450);
  window.setTimeout(function() {
    jQuery('input').css({"border-top-color": 'red'}).animate({
        borderWidth: 4
    }, 500, 'swing');
  }, 600);
});

Hope this will help!!

希望这会有所帮助!!

更多相关文章

  1. JQuery滚动条插件jScrollPane的详细使用(除去点击边框)
  2. html中文本域选中后会出现蓝边框
  3. 里面的获得蓝色边框
  4. 我得到一个警告坏js小提琴配置
  5. 8.HTML5 CSS3 背景、边框与补丁相关属性
  6. 填充HTML表格列,两个边框?
  7. 如果没有内容,隐藏边框
  8. 当页面上有多个按钮时,按钮样式在页面加载上有厚的边框
  9. 获取html DOM元素内容的边框

随机推荐

  1. Android开发者e周报 第4期
  2. 全面解析Android事件分发机制:一篇足矣!
  3. Android(安卓), and
  4. Android支付密码输入框
  5. Android平板电脑全球已激活1200万台 今年
  6. Android面试看重你什么?(推荐!!!)
  7. Android4.0 Design之UI设计易犯的错误1
  8. Android进程的so注入--Poison(稳定注入版)
  9. 想抢先体验Android操作系统的魅力吗?那就
  10. Android设计(起步篇)