.animate() - 旧 jquery 版本(Drupal)冲突的队列模拟 [英] .animate() - Queue Simulation for older jquery Verions (Drupal) Conflict

查看:16
本文介绍了.animate() - 旧 jquery 版本(Drupal)冲突的队列模拟的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种解决方案来推出 jquery 版本,Drupal 原生包含了该版本.它的旧版本.实际上没有问题 - 但是一个 :DI 使用带有队列 false 的 .animate() 函数,如果没有这个属性(因为这个属性是在 jquery 1.7 中添加到 .animate() 的),它不是我想要的动画.

代码是:

//鼠标滑过时$("#login").bind('mouseover mouseenter',function(){$("#logo").stop().delay(500).animate({top:'-44px'},{queue:false, duration:600, easing: 'swing'})$("#login").stop().animate({top:'89px'},{queue:false, duration:600, easing: 'easeOutBounce'})});//当鼠标被移除时$("#login").bind('mouseout mouseleave',function(){$("#logo").stop().animate({top:'6px'},{queue:false, duration:600, easing: 'easeOutBounce'})$("#login").stop().animate({top:'40px'},{queue:false, duration:600, easing: 'swing'})});

也许你能帮我找到解决办法?问题,为什么我要排除我为此使用的 jquery 版本(1.8.3)是 Drupal 模块没有显示所见即所得(CKEditor),当 jquery 1.8.3 被额外包含时,不幸的是我无法替换 jquery带有 jquery 1.8.3 的核心版本:(

解决方案

我一直通过普通的 vanilla js 来完成此操作;通过简单地在延迟/超时时触发事件.这解决了队列问题.

在 JsFiddle 上查看.