There is a site where the slider script was on for about three years:

<script type="text/javascript"> var foto = <?php echo get_photo_for_slideshow(); ?> foto = jQuery.shuffle(foto); jQuery(document).ready(function($){ jQuery(".gallery img").fadeTo( 500, 0.5); jQuery(".gallery img").bind("mouseover",function(){ jQuery(this).fadeTo(500,1); }); jQuery(".gallery img").bind("mouseleave",function(){ jQuery(this).fadeTo(500,0.5); }); jQuery(window).bind("resize",function(){ var plotis = -1*Math.round(((2400-$(window).width())/2)); $("#juosta ul ").css("margin-left",plotis+"px"); }); $.each(foto, function(index, value) { $("#juosta ul").append("<li><img id='foto_"+index+"_1' src='/wp-content/plugins/sets/upload/"+value+"' style=\"opacity: 0\"/><img id='foto_"+index+"_2' src=\"/wp-content/plugins/sets/upload/"+value+"\" style=\"opacity: 0\" /></li>"); var time = 500*(index+1); if(index == 0){ var plotis = -1*Math.round(((2400-$(window).width())/2)); $("#juosta ul").css("margin-left",plotis+"px"); } jQuery(document).oneTime(time, function(){ $("#foto_"+index+"_1").animate({ opacity: 1 }, 500, function() { // Animation complete. }); }); }); jQuery(document).everyTime(5000, "base", function(){ foto = jQuery.shuffle(foto); var b = foto.shift(); foto[foto.length] = b; //foto.reverse(); $.each($(foto), function(index, value) { var time = 1000*(index+1); $(document).oneTime(time, function(){ if($("#foto_"+index+"_1").css("opacity")=="1"){ // pirma foto matoma $("#foto_"+index+"_1").animate({opacity: 0},1000); $("#foto_"+index+"_2").attr("src","/wp-content/plugins/sets/upload/"+value).animate({opacity: 1},1000); }else{ // antra foto matoma $("#foto_"+index+"_1").attr("src","/wp-content/plugins/sets/upload/"+value).animate({opacity: 1},1000); $("#foto_"+index+"_2").animate({opacity: 0},1000); } }); }); }); }); </script> 

Now I want to include the spoiler script: <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> When I I add the script before the spoiler tag starts to work, but the slider disappears. Help me find the cause.

Closed due to the fact that the essence of the question is not clear to the participants: aleksandr barakin , Grundy , user194374, Pavel Parshin , Suvitruf 18 Feb '16 at 8:29 .

Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • one
    Without details on the slider and spoiler, no one can help you. But you, clearly, the conflict between the scripts. See the browser console, there are certainly errors. - Andrew Hobbit
  • one
    The solution to save the current functionality and the new one is to rewrite the script, either old or new through jQuery.noConflict() . - Jean-Claude
  • I have a suspicion that there is no second library there. This is the actual page, you will see the spoiler, and the slider should be in a large strip: tifani.by/kariera/rabota-v-restorane - Valery Emelyanov
  • Transfer this to the question - tutankhamun

3 answers 3

most likely you have another version of jquery connected - as a result, there is a conflict between versions

  • one
    Most likely the vendor is tied to the old jquery, suppose version 1.6 there could be clicked through elem.live ('click'), but when you connect the new version of the live library, the result is cut out, you do not support some functions that are outdated. - Kirya
  • And how should I be now? - Valery Emelyanov
  • I have a suspicion that there is no second library there. Here is the actual page, you will see the spoiler, and the slider should be in a large strip: tifani.by/kariera/rabota-v-restorane - Valery Emelyanov
  • hmm, really kind of like no. Perhaps because of Uncaught TypeError: Cannot read property 'msie' of undefined and crashes. This error occurs because $ .browser is removed from jQuery1.9. There are workarounds, but I would advise you to look for some other suitable plugin ... - Boris Runs

Given your link to the problem page, you can see the following:

Error: jQuery.browser is undefined Source: http://www.tifani.by/wp-content/themes/tifani/js/jquery.timers.js Line: 152

Not surprisingly, jQuery.browser was deprecated and removed from the library with the release of version 1.9, and you connect jQuery version 1.11. Either connect jQuery.migrate , or rewrite jquery.timers.js

    I solved the problem in this way, moved both codes to the head and arranged it in a certain order using a spear method. All answered thanks!