Jquery lavalamp and auto scroll attenuation issue (conflict)

I have a problem and I really hope you guys can help.

http://ontwikkelomgeving.wijzijnblits.nl/primawonen/ Here you can find the website that I am currently creating.

As you can see, the auto-scroll job (called het laatste aanbod). For this, the easing.min.js plugin is used. I use lavalamp for navigation, however this is not working right now.

The problem is the easing plugin. If I use an older version of this plugin, lavalamp works. Great, you might think, but then the autoscrolling script does not work. How can I make both work ?!

I am seriously stuck with this and hope you guys can help me.

thnx in advance

+3
source share
2 answers

I had the same problem and I just figured out how to do this, add the following lines above everything else in lavalamp.js

jQuery.extend( jQuery.easing,
{ 
    bouncein: function(x, t, b, c, d) {
        return c - jQuery.easing["bounceout"](x, d - t, 0, c, d) + b;
    },    
    backout: function(x, t, b, c, d) {
        var s = 1.70158;
        return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b;
    }

});

And remove the easing plugin. It worked for me.

+4
source

I had the same problem with two conflicting jquery libraries and found this http://docs.jquery.com/Using_jQuery_with_Other_Libraries

This method worked for me - the order of the scripts is important:

      <script src="secondary-jquery-script.js"></script>
   <script src="jquery-original-script.js"></script>
   <script>
     var $j = jQuery.noConflict();

     // Here comes the part that needs jquery-Original-script.js - jQuery via $j(...)
     $j(document).ready(function(){
       $j("div").hide();
     });

     // and here comes the part that needs the secondary script
     $('someid').hide();
   </script>
+1
source

Source: https://habr.com/ru/post/1768392/


All Articles