{"id":294407,"date":"2019-09-08T15:00:12","date_gmt":"2019-09-08T15:00:12","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=294407"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=294407","title":{"rendered":"\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u043b\u0430\u0439\u0434\u0435\u0440\u0430 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Jquery"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\n<p>\u041e\u0447\u0435\u043d\u044c \u0447\u0430\u0441\u0442\u043e \u043d\u0430 \u0441\u0430\u0439\u0442\u0430\u0445 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u043c\u0430\u0433\u0430\u0437\u0438\u043d\u043e\u0432, \u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e, \u043c\u043e\u0436\u043d\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u044b \u0441\u043e \u0441\u043b\u0430\u0439\u0434\u0435\u0440\u043e\u043c \u0432\u044b\u0431\u043e\u0440\u0430 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439. \u0412 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u043c\u043d\u0435 \u0442\u043e\u0436\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u043e\u0441\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u0441\u043b\u0430\u0439\u0434\u0435\u0440. <\/p>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0432 \u0433\u043e\u043b\u043e\u0432\u0443 \u2014 \u043d\u0430\u0439\u0442\u0438 \u0443\u0436\u0435 \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u0438 \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u0435\u0431\u0435 \u043d\u0430 \u0441\u0430\u0439\u0442. \u0422\u0443\u0442 \u0442\u043e \u044f \u0438 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439. \u041d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0439 \u043c\u043d\u043e\u044e \u043f\u043b\u0430\u0433\u0438\u043d JqueryUI.slider \u043e\u0442\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u044f \u0432\u044b\u044f\u0432\u0438\u0442\u044c \u043d\u0435 \u0441\u043c\u043e\u0433 (\u0434\u0430 \u043d\u0435 \u043e\u0441\u043e\u0431\u043e \u0438 \u0445\u043e\u0442\u0435\u043b \u043a\u043e\u0432\u044b\u0440\u044f\u0442\u044c\u0441\u044f \u0432 \u0447\u0443\u0436\u043e\u043c \u043a\u043e\u0434\u0435) \u0438 \u0440\u0435\u0448\u0438\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0432\u043e\u0439 &quot;\u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434&quot;.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<p>&quot;\u0412\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434&quot; \u044f \u0440\u0435\u0448\u0438\u043b \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430 \u0447\u0438\u0441\u0442\u043e\u043c JavaScript, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c\u0438. \u041a\u0430\u043a \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043e\u0434\u0438\u043d \u043c\u043e\u0439 \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u0439: &quot;\u0447\u0435\u043c \u043c\u0435\u043d\u044c\u0448\u0435 &quot;\u043b\u0435\u0432\u044b\u0445&quot; \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439, \u0442\u0435\u043c \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u0435\u0439 \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442&quot;. <\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u043f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u0441\u0432\u0435\u0440\u0441\u0442\u0430\u043b \u0442\u0430\u043a\u043e\u0439 \u0432\u043e\u0442 \u043f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u0438\u0439 \u043c\u0430\u043a\u0435\u0442<\/p>\n<p>  <\/p>\n<pre><code class=\"xml\">&lt;div class=&quot;filter&quot;&gt;         &lt;div&gt;             &lt;span&gt;\u0424\u0438\u043b\u044c\u0442\u0440 1&lt;\/span&gt;             &lt;div&gt;&lt;number&gt;10&lt;\/number&gt;&lt;number&gt;50&lt;\/number&gt;&lt;\/div&gt;             &lt;div class=&quot;slider&quot;&gt;                 &lt;div class=&quot;block-min&quot; onMouseDown=&quot;moveRange(this)&quot; onTouchStart=&quot;moveRange(this)&quot;&gt;&lt;\/div&gt;                 &lt;div class=&quot;color-range&quot;&gt;&lt;\/div&gt;                 &lt;div class=&quot;block-max&quot; onMouseDown=&quot;moveRange(this)&quot; onTouchStart=&quot;moveRange(this)&quot;&gt;&lt;\/div&gt;             &lt;\/div&gt;         &lt;\/div&gt;         &lt;div&gt;             &lt;span&gt;\u0424\u0438\u043b\u044c\u0442\u0440 2&lt;\/span&gt;             &lt;div&gt;&lt;number&gt;0&lt;\/number&gt;&lt;number&gt;5&lt;\/number&gt;&lt;\/div&gt;             &lt;div class=&quot;slider&quot;&gt;                 &lt;div class=&quot;block-min&quot; onMouseDown=&quot;moveRange(this)&quot; onTouchStart=&quot;moveRange(this)&quot;&gt;&lt;\/div&gt;                 &lt;div class=&quot;color-range&quot;&gt;&lt;\/div&gt;                 &lt;div class=&quot;block-max&quot; onMouseDown=&quot;moveRange(this)&quot; onTouchStart=&quot;moveRange(this)&quot;&gt;&lt;\/div&gt;             &lt;\/div&gt;         &lt;\/div&gt;     &lt;\/div&gt;<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435 \u043e\u043d \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/lv\/wz\/jq\/lvwzjqatnfexfo9w5yj4l0vccmi.png\"\/><br \/>  \u0421\u0430\u043c \u0441\u043b\u0430\u0439\u0434\u0435\u0440 \u0441 \u043f\u043e\u043b\u0437\u0443\u043d\u043a\u0430\u043c\u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0431\u043b\u043e\u043a\u0435 \u0441 \u043a\u043b\u0430\u0441\u0441\u043e\u043c &quot;slider&quot; \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0435\u0441\u0442\u044c \u0435\u0449\u0435 2 \u0431\u043b\u043e\u043a\u0430: \u043f\u043e\u043b\u0437\u0443\u043d\u043e\u043a \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438 \u043f\u043e\u043b\u0437\u0443\u043d\u043e\u043a \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430.<br \/>  \u0412 \u043d\u0438\u0445 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0434\u0432\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u044f: <\/p>\n<p>  <\/p>\n<ol>\n<li>onMouseDown \u2014 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0437\u0430\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u043c\u044b\u0448\u044c\u044e \u043f\u043e\u043b\u0437\u0443\u043d\u043e\u043a;<\/li>\n<li>onTouchStart \u2014 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445, \u043f\u0440\u0438 \u043a\u0430\u0441\u0430\u043d\u0438\u0438 \u043f\u0430\u043b\u044c\u0446\u0430 \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u043f\u043e\u043b\u0437\u0443\u043d\u043a\u0443.<\/li>\n<\/ol>\n<p>  <\/p>\n<p>\u041d\u0430\u0434 slider-\u043e\u043c \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0431\u043b\u043e\u043a \u0441 \u0434\u0432\u0443\u043c\u044f \u0447\u0438\u0441\u043b\u0430\u043c\u0438 \u2014 \u044d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c \u043d\u0430\u0448\u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0438 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f.<\/p>\n<p>  <\/p>\n<pre><code class=\"xml\">&lt;div&gt;&lt;number&gt;0&lt;\/number&gt;&lt;number&gt;5&lt;\/number&gt;&lt;\/div&gt;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0441\u0430\u043c\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043a\u043b\u0438\u043a\u0435.<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">function moveRange (elem) {         \/\/\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0440\u0430\u0437\u043c\u0435\u0440\u044b \u0438 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u043e\u043b\u0437\u0443\u043d\u043a\u0430     var coords = getCoords(elem);      \/*\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0437\u043e\u043d\u0443 \u043e\u043a\u0440\u0430\u0448\u0438\u0432\u0430\u043d\u0438\u044f*\/     var colorRange = elem.parentElement.children[1];     var f;\/\/\u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0444\u043b\u0430\u0433 \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043c\u0438\u043d \u0438\u043b\u0438 \u043c\u0430\u043a\u0441 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430     var value; \/\/\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u0430      \/*\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0432\u0442\u043e\u0440\u043e\u0439 \u043f\u043e\u043b\u0437\u0443\u043d\u043e\u043a \u0438 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044f*\/     var parent = {}         parent.element = elem.parentElement;         parent.coords = getCoords(parent.element);      var block2 = {}     if (elem.classList.contains('block-min')) {         block2.element = elem.parentElement.children[2];         block2.coords = getCoords(block2.element);         f=0;     } else {         block2.element = elem.parentElement.children[0];         block2.coords = getCoords(block2.element);         f=1;     }      \/*\u0414\u0435\u043b\u0430\u0435\u043c \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440 \u0432\u044b\u0432\u043e\u0434\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043d\u0430\u0434 \u043f\u043e\u043b\u0437\u0443\u043d\u043a\u043e\u043c*\/     var indicator = document.createElement('div');     if (elem.children.length){         elem.innerHTML = '';\/\/\u043e\u0431\u043d\u0443\u043b\u044f\u0435\u043c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435     }     elem.append(indicator);      document.addEventListener('mousemove', onMouseMove);\/\/\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e-\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f \u043c\u044b\u0448\u044c\u044e     document.addEventListener('mouseup', onMouseUp);\/\/\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e-\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043e\u0442\u043f\u0443\u0441\u043a\u0430\u043d\u0438\u044f \u043a\u043d\u043e\u043f\u043a\u0438 \u043c\u044b\u0448\u0438     document.addEventListener('touchmove', onMouseMove);\/\/\u0437\u0434\u0435\u0441\u044c \u0432\u0441\u0435 \u0442\u043e\u0436\u0435 \u0441\u0430\u043c\u043e\u0435, \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043a\u0430\u0441\u0430\u043d\u0438\u0435 \u043f\u0430\u043b\u044c\u0446\u0435\u043c     document.addEventListener('touchend', onMouseUp);      \/*\u0432\u044b\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043d\u043e\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 DaD*\/     elem.ondragstart = function(){         return false;     }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f getCoords \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u044b \u043d\u0430\u0448\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432.<br \/>  \u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043e\u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c.<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">function getCoords(elem) {     \/*\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u043a\u043d\u0430 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430*\/     let coords = elem.getBoundingClientRect();     \/*\u0412\u044b\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430, \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u044f \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0443 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430*\/     return {\/\/\u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442:         top : coords.top + window.pageYOffset, \/\/\u0432\u0435\u0440\u0445\u043d\u044e\u044e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b         left : coords.left + window.pageXOffset, \/\/\u043a\u0440\u0430\u0439\u043d\u044e\u044e \u043b\u0435\u0432\u0443\u044e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b         leftX: coords.left, \/\/\u043b\u0435\u0432\u0443\u044e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0443 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b         rigth : coords.left + window.pageXOffset + coords.width, \/\/\u043a\u0440\u0430\u0439\u043d\u044e\u044e \u043f\u0440\u0430\u0432\u0443\u044e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0443         bottom : coords.top + window.pageYOffset + coords.height, \/\/\u043d\u0438\u0436\u043d\u044e\u044e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0443         width : coords.width \/\/\u0448\u0438\u0440\u0438\u043d\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430     } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043e\u043f\u0438\u0448\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0438-\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438.<br \/>  \u041f\u0435\u0440\u0432\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u2014 onMouseMove, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0438 \u043c\u044b\u0448\u044c\u044e. \u041e\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u043c \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0438.<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">function onMouseMove(e) {          \/*\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0432\u043b\u0435\u0432\u043e*\/         e.preventDefault();\/\/\u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u0437\u0430\u043f\u0443\u0441\u043a \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432          \/*\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u044b\u0448\u0438 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430*\/         \/*\u041d\u0430 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445 \u043c\u043e\u0436\u0435\u0442 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u0447\u0435\u043a \u043a\u0430\u0441\u0430\u043d\u0438\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043c\u0430\u0441\u0441\u0438\u0432 targetTouches*\/         \/*\u041c\u044b \u0431\u0443\u0434\u0435\u043c \u0431\u0440\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0432\u043e\u0435 \u0437\u0430\u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043e\u0435 \u043a\u0430\u0441\u0430\u043d\u0438\u0435 \u043f\u043e \u044d\u043a\u0440\u0430\u043d\u0443 targetTouches[0]*\/         if (e.touches === undefined) {             var pos = e.clientX;         } else {             var pos = e.targetTouches[0].clientX;         }          \/*\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u0437\u0443\u043d\u043a\u0430*\/         let newLeft = pos - parent.coords.leftX;         let rigthEdge = parent.coords.width - (coords.width+1);          if (newLeft&lt;0) {             newLeft = 0;         } else if (newLeft &gt; rigthEdge) {             newLeft = rigthEdge;         }         if (f == 0 &amp;&amp; pos &gt; block2.coords.left-block2.coords.width) {             newLeft = block2.coords.left - block2.coords.width - 5 - parent.coords.leftX;         }else if (f == 1 &amp;&amp; pos &lt; block2.coords.rigth + 5) {             newLeft = block2.coords.rigth + 5 - parent.coords.leftX;         }         \/*\u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043e\u0442\u0441\u0442\u0443\u043f \u043d\u0430\u0448\u0435\u043c\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443*\/         elem.style.left = newLeft + 'px';          \/\/     \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u0430         let rangeMin = +document.querySelector('.filter number:first-child').innerHTML;         let rangeMax = +document.querySelector('.filter number:last-child').innerHTML;         if(f==0){           value =  (newLeft \/ (parent.coords.width \/ (rangeMax - rangeMin)) + rangeMin).toFixed(1);         } else {           value = (newLeft \/ (parent.coords.width \/ (rangeMax - rangeMin))+ 0.3 + rangeMin).toFixed(1);         }          \/*\u0412\u044b\u0432\u043e\u0434\u0438\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0430\u0434 \u043f\u043e\u043b\u0437\u0443\u043d\u043a\u043e\u043c*\/         indicator.style.position = 'absolute';         indicator.style.fontSize = &quot;14px&quot;;         indicator.style.left = - coords.width\/2 + &quot;px&quot;;         indicator.style.top = parseFloat(window.getComputedStyle(elem).getPropertyValue('top')) - 10 +&quot;px&quot;;          \/*\u0414\u043b\u044f \u043a\u0440\u0430\u0441\u043e\u0442\u044b \u0441\u043b\u0430\u0439\u0434\u0435\u0440\u0430 \u0443\u0431\u0435\u0440\u0435\u043c \u0432\u044b\u0432\u043e\u0434 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0430\u0445*\/         if (newLeft &lt;= 0){             indicator.innerHTML= &quot;&quot;;         } else if (newLeft &gt;= rigthEdge) {             indicator.innerHTML= &quot;&quot;;         } else {             indicator.innerHTML = value;         }          \/*\u0414\u0435\u043b\u0430\u0435\u043c \u0446\u0432\u0435\u0442\u043d\u0443\u044e \u043f\u043b\u0430\u0448\u0435\u0447\u043a\u0443 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430 \u0432\u044b\u0431\u043e\u0440\u0430*\/         if (f == 0) {             colorRange.style.left = newLeft + coords.width + &quot;px&quot;;             colorRange.style.width = block2.coords.left - getCoords(elem).left - coords.width + &quot;px&quot;;         }  else {             colorRange.style.left = block2.coords.left - parent.coords.leftX + &quot;px&quot;;             colorRange.style.width = getCoords(elem).left - block2.coords.left + &quot;px&quot;;         }     }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418, \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u0444\u0443\u043d\u043a\u0446\u0438\u044f-\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441\u043e\u0431\u044b\u0442\u0438\u044f &quot;\u043e\u0442\u043f\u0443\u0441\u043a\u0430\u043d\u0438\u044f \u043a\u043d\u043e\u043f\u043a\u0438&quot; \u0438\u043b\u0438 \u043f\u043e\u0442\u0435\u0440\u0438 \u0442\u043e\u0447\u043a\u0438 \u043a\u0430\u0441\u0430\u043d\u0438\u044f \u043d\u0430 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445. \u041e\u043d\u0430 \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0432\u0441\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0440\u0430\u043d\u0435\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0438 \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u0437\u0443\u043d\u043e\u043a \u043d\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0438.<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">function onMouseUp() {         document.removeEventListener('mouseup', onMouseUp);         document.removeEventListener('mousemove', onMouseMove);         document.removeEventListener('touchend', onMouseUp);         document.removeEventListener('touchmove', onMouseMove);     }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, CSS-\u0441\u0442\u0438\u043b\u0438 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u043b\u0430\u0439\u0434\u0435\u0440\u0430<\/p>\n<p>  <\/p>\n<pre><code class=\"css\">.filter {     padding: 30px;     width: 500px; } .filter&gt;div {     padding-top: 20px;     display: -webkit-flex;     display: -moz-flex;     display: -ms-flex;     display: -o-flex;     display: flex;     -webkit-flex-direction: column;     -moz-flex-direction: column;     -ms-flex-direction: column;     -o-flex-direction: column;     flex-direction: column; } .filter&gt;div&gt;div {     display: -webkit-flex;     display: -moz-flex;     display: -ms-flex;     display: -o-flex;     display: flex;     justify-content: space-between; } .filter .slider {     margin-top: 10px;     position: relative;     height: 6px;     background: #fff;     border: 1px solid #000; } .filter .color-range {     position: absolute;     background: #a4a4a4;     width: 97%;     border: none;     height: 6px;     left: 15px; } .filter .block-min, .block-max {   width: 15px;   height: 25px;   position: absolute;   left: 0;   top: -11.5px;   background: #fff;   border: 1px solid #000;   border-radius: 4px;   z-index: 1; } .filter .block-max{     left: 97%; }<\/code><\/pre>\n<p>  <\/p>\n<p><a href=\"https:\/\/codepen.io\/zhenya-2304\/pen\/ZEzJqER\">\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0440\u0430\u0431\u043e\u0447\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u043b\u0430\u0439\u0434\u0435\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<p>  <\/p>\n<p><a href=\"https:\/\/github.com\/zhenya-2304\/multiple-input-range\">\u0412\u0441\u0435 \u0444\u0430\u0439\u043b\u044b \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0441 GitHub<\/a>.<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0438\u044f\u0442\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043b\u0435\u0433\u043a\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b!<\/p>\n<\/div>\n<p>               <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/466623\/\"> https:\/\/habr.com\/ru\/post\/466623\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\n<p>\u041e\u0447\u0435\u043d\u044c \u0447\u0430\u0441\u0442\u043e \u043d\u0430 \u0441\u0430\u0439\u0442\u0430\u0445 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u043c\u0430\u0433\u0430\u0437\u0438\u043d\u043e\u0432, \u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e, \u043c\u043e\u0436\u043d\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u044b \u0441\u043e \u0441\u043b\u0430\u0439\u0434\u0435\u0440\u043e\u043c \u0432\u044b\u0431\u043e\u0440\u0430 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439. \u0412 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u043c\u043d\u0435 \u0442\u043e\u0436\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u043e\u0441\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u0441\u043b\u0430\u0439\u0434\u0435\u0440. <\/p>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0432 \u0433\u043e\u043b\u043e\u0432\u0443 \u2014 \u043d\u0430\u0439\u0442\u0438 \u0443\u0436\u0435 \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u0438 \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u0435\u0431\u0435 \u043d\u0430 \u0441\u0430\u0439\u0442. \u0422\u0443\u0442 \u0442\u043e \u044f \u0438 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439. \u041d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0439 \u043c\u043d\u043e\u044e \u043f\u043b\u0430\u0433\u0438\u043d JqueryUI.slider \u043e\u0442\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u044f \u0432\u044b\u044f\u0432\u0438\u0442\u044c \u043d\u0435 \u0441\u043c\u043e\u0433 (\u0434\u0430 \u043d\u0435 \u043e\u0441\u043e\u0431\u043e \u0438 \u0445\u043e\u0442\u0435\u043b \u043a\u043e\u0432\u044b\u0440\u044f\u0442\u044c\u0441\u044f \u0432 \u0447\u0443\u0436\u043e\u043c \u043a\u043e\u0434\u0435) \u0438 \u0440\u0435\u0448\u0438\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0432\u043e\u0439 &quot;\u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434&quot;.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-294407","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/294407","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=294407"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/294407\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=294407"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=294407"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=294407"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}