Last night everything was fine, there were no lags / bugs. I woke up this morning and can't find a problem. So.
I have a slider at the beginning of the page. In the admin panel, I added the ability to collapse it. In expanded form, it looks like this: joxi_screenshot_1474553856809.png http://s16.postimg.org/lhkccclhx/joxi_screenshot_1474553856809.png
In collapsed: joxi_screenshot_1474553856809 (1) .png http://s13.postimg.org/h36fv47hz/joxi_screenshot_1474553856809_1.png
In the header of the site, I connect everything you need:
<link rel="stylesheet" href="<?= PATH ?>css/admin.css"> <script src="<?= PATH ?>js/jquery.js"></script> <script src="<?= PATH ?>js/storage.js"></script> <script src="<?= PATH ?>js/cookie.js"></script> <script src="<?= PATH ?>js/transliteration.js"></script> <script src="<?= PATH ?>js/tinymce/tinymce.min.js"></script> <script src="<?= PATH ?>js/control_panel.js"></script> <link rel="shortcut icon" href="<?= PATH ?>image/favicon.png" type="image/png"> Execution script itself:
$(document).ready(function () { var sliderBlock = $('.sliderBlock'); var hideSlider = $('#hideSlider'); var storage = $.localStorage; if (storage.get('_slider') == 'hide') { sliderBlock.css({'height': '50px'}); hideSlider.css({'transform': 'rotate(-45deg)'}) } hideSlider.click(function () { if (storage.get('_slider') == 'show' || !storage.get('_slider')) { storage.set('_slider', 'hide'); sliderBlock.css({'height': '50px'}); hideSlider.css({'transform': 'rotate(-45deg)'}) } else { storage.set('_slider', 'show'); hideSlider.css({'transform': 'rotate(0)'}); sliderBlock.css({'height': '350px'}) } }) }); // Slider SHOW / HIDE functions I connected the storage.js library, when loading the page it checks the value of storage.get('_slider') , it can be hide and show . I always had a hide .
Yesterday, even when the page was loaded, the slider always loaded in a minimized form; today, I don’t know why, the page with the open slider is loaded, and then the slider is reduced to 50 pixels. I am puzzling all day because of what could have happened.
Could this be due to the speed of PHP scripts? What could be the reasons?
UPDATE | file description control_panel.js
And so, everyone else goes after the slider control function.
- Opens / closes the login window. Starts working by clicking on a button.
- Hides a block of messages with an answer to an action that appears after reloading the page. It works only if there is such a response from the server, and hides the block by clicking
- AJAX data transfer method post, after changes were observed in different input, including in the slider. Slider text is transparent
- Opening and hiding information blocks. They are only on one page, also works by clicking on the button
- Transliteration url (from Cyrillic to Lat. By clicking on the button).
- TinyMCE - turns everything into an HTML editor
No more features. Only one slider has always worked and works on all pages and immediately when the page loads
$(document).ready(...except for the question? - Igor$(document).readyare before or after, what do they do? Remove them one by one. - Igor