JQuery error suddenly appeared on all versions of the website

I am working on a website that has some animations implemented using jQuery. All this is wonderful, and I have already finished work on this part of the site. One way or another, my menu, which uses the plugin to read pages , stops working as expected. The animation still works, but instead of a menu sliding to the left to show its full width, it slides twice as wide. This happens on all browsers and devices, and probably wasn’t yesterday.

I will send the code in question at the end of this post, but I really don't think this is related to any code that I have. I use version control when building, and this error has appeared in all versions, locally and remotely. Therefore, the remote site with which I did not touch, since it worked, now does not work.

This tells me that this is not a problem with one of the files that are part of the site. However, I have only 2 external files associated with the site. The first is modernization, and disabling it does not matter; the second is jQuery. I tried to change the jQuery version to everything from about 1.10 to 2.0, but without joy.

Now I'm a little out of ideas.

Here's the pagelide.js bit that controls the menu opening:

// Function that controls opening of the pageslide function _start( direction, speed ) { var slideWidth = $pageslide.outerWidth( true ), bodyAnimateIn = {}, slideAnimateIn = {}; // If the slide is open or opening, just ignore the call if( $pageslide.is(':visible') || _sliding ) return; _sliding = true; switch( direction ) { case 'left': $pageslide.css({ left: 'auto', right: '-' + slideWidth + 'px' }); bodyAnimateIn['margin-left'] = '-=' + slideWidth; slideAnimateIn['right'] = '+=' + slideWidth; break; default: $pageslide.css({ left: '-' + slideWidth + 'px', right: 'auto' }); bodyAnimateIn['margin-left'] = '+=' + slideWidth; slideAnimateIn['left'] = '+=' + slideWidth; break; } // Animate the slide, and attach this slide settings to the element $body.animate(bodyAnimateIn, speed); $pageslide.show() .animate(slideAnimateIn, speed, function() { _sliding = false; }); } 

Thanks so much for any help.

+4
source share
1 answer

I solved this problem, and although, as I said, I looked at various versions of jQuery from 1.0 to 2.0, I did not include micro issues between 1.6 and 1.7, for example. Testing 1.6.1 etc. That was what I was missing, and that, of course, was the problem. Anyone else having the same problem should check all subelements.

+2
source

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


All Articles