Javascript 重置除当前悬停元素外的所有其他jQuery动画

Javascript 重置除当前悬停元素外的所有其他jQuery动画,javascript,jquery,html,css,Javascript,Jquery,Html,Css,所以我的代码有问题。它工作正常。但是我有三个盒子挨着一个。在悬停时,他们会做一些事情。。。改变宽度。我遇到的问题。如果你把鼠标移到它们上面,它们都会启动。但我只想要一个你能阻止你的鼠标的 因此,当我将鼠标悬停在这些框中的任何一个上时,我需要重置所有其他动画,以阻止一次设置多个框的动画。谢谢 jquery css html 为了向您证明我们的能力、价值和品格,我们将在最初的30天内免费完成以下所有工作: 自由定位评估(分析成功所需的内容) 免费网站评估 免费登录页评估 在AdWords或Bin

所以我的代码有问题。它工作正常。但是我有三个盒子挨着一个。在悬停时,他们会做一些事情。。。改变宽度。我遇到的问题。如果你把鼠标移到它们上面,它们都会启动。但我只想要一个你能阻止你的鼠标的

因此,当我将鼠标悬停在这些框中的任何一个上时,我需要重置所有其他动画,以阻止一次设置多个框的动画。谢谢

jquery css html


为了向您证明我们的能力、价值和品格,我们将在最初的30天内免费完成以下所有工作:
  • 自由定位评估(分析成功所需的内容)
  • 免费网站评估
  • 免费登录页评估
  • 在AdWords或Bing上为PPC活动设置免费(完整)帐户
  • 免费关键字列表构建和部署
  • 免费广告活动的设计与实施
  • 免费谷歌分析和评估
  • 免费电话咨询,讨论您的帐户
  • 我们不免费做的事情:
  • 网站开发
  • 登录页重新设计
  • 本地上市管理
  • 在线声誉管理
  • 观众再营销活动
  • 实时聊天服务
  • 即时电子邮件提醒
  • 电话录音和跟踪
  • 网站SEO优化
  • 我们真诚的目标是:
  • 分析贵公司当前的市场地位
  • 确定您需要哪些工具和在线活动来增加销售和客户群
  • 制定有效的计划,通过增加客户来促进公司的发展
  • 有效地实施成本效益高的广告活动,让每一美元的支出都得到最大的回报
  • 在相互信任、尊重和表现的基础上建立持久的友谊
    您可以使用stopPropagation方法,这样现在会触发不止一个您停止鼠标的方法。根据需要调整延迟(500)以达到所需效果

    var time;
    function animatedText() {
    
      $('.animated-text-content').css('display', 'none');
    
      $('.animated-text').on('mouseenter', function(e) {
        if(time){
            clearTimeout(time);   
        }
        e.stopPropagation();
        $(this).find('.animated-text-animation').css('justify-content', 'flex-start');
        $(this).find($('.animated-text-content')).delay(600).fadeIn(800);
      });
    
    
      $('.animated-text').on('mouseleave', function(e) {
        time = setTimeout($.proxy(function(){
            $(this).find('.animated-text-animation').css('justify-content', 'center');
            $(this).find($('.animated-text-content')).fadeOut(250);
        }, this),500); //Delay   <-------
      });
    }
    
    var时间;
    函数animatedText(){
    $('.animated text content').css('display','none');
    $('.animated text')。on('mouseenter',函数(e){
    如果(时间){
    clearTimeout(时间);
    }
    e、 停止传播();
    $(this).find('.animated text animation').css('justify-content','flex start');
    $(this).find($('.animated text content')).delay(600).fadeIn(800);
    });
    $('.animated text')。打开('mouseleave',函数(e){
    time=setTimeout($.proxy(function()函数){
    $(this).find('.animated text animation').css('justify-content','center');
    $(this.find($('.animated text content')).fadeOut(250);
    
    },this),500);//延迟如何调用
    animatedText()
    函数?从您显示的代码中,只有CSS影响div的显示。它在先前的js中调用。我只是因为相关性而没有添加
    .animated-text {
      min-width: 33.333%;
      min-height: 700px;
      display: flex;
      align-items: center;
      justify-content: center;
      background-position: center;
      background-size: cover;
      transition: all 0.7s ease-in-out;
    }
    
    .animated-text-animation {
        min-width: 50%;
        min-height: 550px;
        display: flex;
        align-items: center;
        justify-content: space-around;
        background-color: rgba(0, 0, 0, 0.7);
        transition: all 1s ease-in-out;
    }
    
    .animated-text:hover .animated-text-animation {
      flex: 1 1 40%;
    }
    
    .animated-text:hover {
        min-width: 50%;
    }
    
    .animated-text-container:hover .animated-text:not(:hover) {
      min-width: 25%;
    }
    
      <div class="animated-text-container">
        <div class="animated-text animated-text-1">
          <div class="animated-text-animation">
            <div class="animated-text-logo animated-text-logo-1"></div>
            <div class="animated-text-content">
              <h1>We will do all of the following for free for the first 30 days to prove our ability, our worth, and our character to you:</h1>
              <li><span>Free Positioning Evaluation (Analyzing What you need to succeed)</span></li>
              <li><span>Free Website Evaluation</span></li>
              <li><span>Free Landing Page Evaluation</span></li>
              <li><span>Free (entire) account set-up for a PPC Campaign on AdWords or Bing</span></li>
              <li><span>Free Keyword List Building and Deployment</span></li>
              <li><span>Free Ad Campaign Design and Implementation</span></li>
              <li><span>Free Google Analytics Analysis and Evaluation</span></li>
              <li><span>Free Phone Consultations to Discuss Your Account</span></li>
            </div>
          </div>
        </div>
    
        <div class="animated-text animated-text-2">
          <div class="animated-text-animation">
    
            <div class="animated-text-logo animated-text-logo-2"></div>
            <div class="animated-text-content">
              <h1>What we do NOT do for free:</h1>
              <div class="li-container">
                <div class="li-content">
                  <li><span>Website Development</span></li>
                  <li><span>Landing Page Redesign</span></li>
                  <li><span>Local Listing Management</span></li>
                  <li><span>Online Reputation Management</span></li>
                  <li><span>Audience Remarketing Campaigns</span></li>
                </div>
                <div class="li-content">
                  <li><span>Live Chat Services</span></li>
                  <li><span>Instant Email Alerts</span></li>
                  <li><span>Call Recording & Tracking</span></li>
                  <li><span>Website SEO Optimization</span></li>
                </div>
              </div>
            </div>
          </div>
        </div>
    
        <div class="animated-text animated-text-3">
          <div class="animated-text-animation">
    
            <div class="animated-text-logo animated-text-logo-3"></div>
            <div class="animated-text-content">
              <h1>It is our earnest goal to:</h1>
              <div class="li-structure">
                <li></li><span>Analyze the current position of your company in the market</span>
              </div>
              <div class="li-structure">
                <li></li><span>Determine what tools and online campaigns you need to increase your sales and customer base</span>
              </div>
              <div class="li-structure">
                <li></li><span>Formulate an effective plan to increase the growth of your company through increased customers</span>
              </div>
              <div class="li-structure">
                <li></li><span>Effectively implement a cost effective advertising campaign to get the most out of every dollar spent</span>
              </div>
              <div class="li-structure">
                <li></li><span>Build an ongoing and long lasting friendship based on mutual trust, respect, and performance</span>
              </div>
            </div>
          </div>
        </div>
    
      </div>
    </div>
    
    var time;
    function animatedText() {
    
      $('.animated-text-content').css('display', 'none');
    
      $('.animated-text').on('mouseenter', function(e) {
        if(time){
            clearTimeout(time);   
        }
        e.stopPropagation();
        $(this).find('.animated-text-animation').css('justify-content', 'flex-start');
        $(this).find($('.animated-text-content')).delay(600).fadeIn(800);
      });
    
    
      $('.animated-text').on('mouseleave', function(e) {
        time = setTimeout($.proxy(function(){
            $(this).find('.animated-text-animation').css('justify-content', 'center');
            $(this).find($('.animated-text-content')).fadeOut(250);
        }, this),500); //Delay   <-------
      });
    }