{"id":160949,"date":"2015-02-02T19:16:00","date_gmt":"2015-02-02T19:16:00","guid":{"rendered":"https:\/\/ru.wordpress.org\/support\/2015\/02\/02\/%d0%be%d1%82%d0%b2%d0%b0%d0%bb%d0%b8%d0%bb%d1%81%d1%8f-jquery\/"},"modified":"2015-02-02T19:16:00","modified_gmt":"2015-02-02T19:16:00","slug":"%d0%be%d1%82%d0%b2%d0%b0%d0%bb%d0%b8%d0%bb%d1%81%d1%8f-jquery","status":"closed","type":"topic","link":"https:\/\/ru.wordpress.org\/support\/topic\/%d0%be%d1%82%d0%b2%d0%b0%d0%bb%d0%b8%d0%bb%d1%81%d1%8f-jquery\/","title":{"rendered":"\u043e\u0442\u0432\u0430\u043b\u0438\u043b\u0441\u044f jquery"},"content":{"rendered":"<p>\u0443 \u043c\u0435\u043d\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0431\u0440\u0435\u0434\u043e\u0432\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441, \u043d\u043e \u0432\u0441\u0451 \u0442\u0430\u043a\u0438 \u043d\u0430\u0434\u0435\u044e\u0441\u044c \u0445\u043e\u0442\u044c \u043d\u0430 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0441\u043e\u0432\u0435\u0442<\/p>\n<p>\u0431\u044b\u043b \u0441\u0430\u0439\u0442 \u043d\u0430 \u0432\u043e\u0440\u0434\u043f\u0440\u0435\u0441\u0441, \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0431\u0435\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c. \u043f\u043e\u0441\u043b\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432\u0441\u0451, \u0447\u0442\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 jquey. \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<pre><code>Consider using &#039;dppx&#039; units, as in CSS &#039;dpi&#039; means dots-per-CSS-inch, not dots-per-physical-inch, so does not correspond to the actual &#039;dpi&#039; of a screen. In media query expression: (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi)\njquery.fancybox.js?ver=1.3.4:18 Uncaught TypeError: Cannot read property &#039;msie&#039; of undefined\njquery.mobile.customized.min.js:1 Uncaught TypeError: Cannot set property &#039;touchstart&#039; of undefined\ncustom-script.js?ver=1.0:1 1234\ncustom-script.js?ver=1.0:4 Uncaught TypeError: undefined is not a function\ncustom.js?ver=1.0:84 Uncaught TypeError: Cannot read property &#039;msie&#039; of undefined<\/code><\/pre>\n<p>\u0432\u043e\u0442 \u043e\u0434\u0438\u043d \u0438\u0437 js-\u0444\u0430\u0439\u043b\u043e\u0432 \u0441 \u0440\u0430\u0441\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0432 \u0446\u0435\u043b\u044f\u0445 \u043e\u0442\u043b\u0430\u0434\u043a\u0438  \u043a\u043e\u043d\u0441\u043e\u043b\u0435\u043b\u043e\u0433\u0430\u043c\u0438():<\/p>\n<pre><code>console.log(1234);\n\n(function($) {\n    $(function(){\n    \tconsole.log(555);\n    \t\/\/Dropdown cart in header\n\t\t$(&#039;.cart-holder &gt; h3&#039;).click(function(){\n\t\t\tif($(this).hasClass(&#039;cart-opened&#039;)) {\n\t\t\t\t$(this).removeClass(&#039;cart-opened&#039;).next().slideUp(300);\n\t\t\t} else {\n\t\t\t\t$(this).addClass(&#039;cart-opened&#039;).next().slideDown(300);\n\t\t\t}\n\t\t});\n\t\t\/\/Popup rating content\n\t\t$(&#039;.star-rating&#039;).each(function(){\n\t\t\trate_cont = $(this).attr(&#039;title&#039;);\n\t\t\t$(this).append(&#039;&lt;b class=&quot;rate_content&quot;&gt;&#039; + rate_cont + &#039;&lt;\/b&gt;&#039;);\n\t\t});\n\n\t    \/* hide second menu *\/\n\t    $(&#039;header .select-menu&#039;).eq(1).css({\n\t    \t&#039;display&#039;: &#039;none&#039;,\n\t    });\n\n\t    \/* cut second menu *\/\n\t    var\tcoll = $(&#039;header .select-menu&#039;).eq(0).find(&#039;option&#039;);\n\t    var length = coll.length;\n\t    var\tlengthDiv = Math.round(length \/ 2) - 1;\n\n\t    $(&#039;header .select-menu&#039;).eq(0).find(&#039;option:gt(&#039; + lengthDiv + &#039;)&#039;).css({\n\t    \t&#039;display&#039;: &#039;none&#039;,\n\t    });\n\n    });\n\n\t\/\/ add wrap cont for catalog stones\n\t$(&#039;body #motopress-main.main-holder .content-holder ul.products .product &gt; a:first-child img&#039;).wrap(&#039;&lt;div class=&quot;sk_catalog_item&quot;&gt;&lt;\/div&gt;&#039;);\n\n\t\/\/ add wrap cont for sidebar right widget\n\t$(&#039;.product_list_widget &gt; li &gt; a &gt; img&#039;).wrap(&#039;&lt;div class=&quot;sk_catalog_item_sidebar&quot;&gt;&lt;\/div&gt;&#039;);\n\n})(jQuery);\n\nconsole.log(666666);\n\n$( document ).ready(function() {\n\t\/\/ add wrap for cart widget\n\tsetTimeout(function(){\n\t\t$(&#039;#shopping_cart-3 .cart_list li a &gt; img&#039;).wrap(&#039;&lt;div class=&quot;sk_catalog_item_cart&quot;&gt;&lt;\/div&gt;&#039;);\n\t}, 2000);\n\n\t\/\/ cart mark full trigger\n\tcart_observer();\n\n\tfunction cart_observer(){\n\t\tsetTimeout(function(){\n\t\t\t\/\/var\tmark = $(&#039;body&#039;).is(&#039;.empty&#039;);\n\n\t\t\tif($(&quot;.empty&quot;).length&gt;0) {\n\t\t\t\t$(&#039;#shopping_cart-3 &gt; .mark_cart&#039;).remove();\n\t\t\t}else{\n\t\t\t\t$(&#039;#shopping_cart-3 &gt; h3&#039;).prepend(&#039;&lt;span class=&quot;mark_cart&quot;&gt;*&lt;\/span&gt;&#039;);\n\t\t\t};\n\t\t}, 2000);\n\t};\n\n\t\/\/ in cart-page change label for checkout-button\n\t$(&#039;#content .shop_table.cart .checkout-button&#039;).val(&#039;\u041e\u0444\u043e\u0440\u043c\u0438\u0442\u044c \u0437\u0430\u043a\u0430\u0437&#039;);\n\n\tsetTimeout(function(){\n\t\t$(&#039;#shopping_cart-3 .buttons .checkout&#039;).text(&#039;\u041e\u0444\u043e\u0440\u043c\u0438\u0442\u044c \u0437\u0430\u043a\u0430\u0437 \u2192&#039;);\n\t}, 2000);\n\n\t\/\/search and make contentwidth 46%\n\t$(&#039;#form_zakaz_outer_top&#039;).next().css({\n\t\t&#039;width&#039;: &#039;70%&#039;\n\t});\n\n\t$(&#039;#form_zakaz_outer_top&#039;).closest(&#039;.entry-content&#039;).find(&#039;table&#039;).eq(0).css({\n\t\t&#039;width&#039;: &#039;70%&#039;\n\t});\t\n\n\t$(&#039;#form_zakaz_outer_top&#039;).closest(&#039;.entry-content&#039;).find(&#039;table&#039;).eq(1).css({\n\t\t&#039;width&#039;: &#039;70%&#039;\n\t});\t\n\n\t\/\/ bottom place for zakaz form\n\tvar\tcontentCollection = $(&#039;section#form_zakaz_outer_top&#039;).nextUntil(&#039;section#form_zakaz_outer_bottom&#039;).get().reverse();\n\tvar\theight = 0,\n\t\tminusHeight = 0;\n\n    $(contentCollection).each(function(){\n    \theight += $(this).outerHeight();\n\n    \tif(height &lt;= 530){\n    \t\t$(this).css({\n    \t\t\t&#039;width&#039;: &#039;70%&#039;\n    \t\t}).attr(&#039;style&#039;, &#039;width:70%&#039;);\n    \t\tminusHeight += height\n    \t}\n    \telse{\n    \t\treturn false;\n    \t};\n    });\n\n\/*    console.log(&#039;======&#039;);\n    console.log(window.location.pathname);*\/\n    if(window.location.pathname == &#039;\/portfolio-view\/dekorativnye-elementy\/&#039;){\n    \t$(&#039;#form_zakaz_outer_bottom&#039;).hide();\n    }\n\n\/*\t$(&#039;#form_zakaz_outer_bottom&#039;).css({\n\t\t&#039;margin-top&#039;: &#039;-600px&#039;\n\t}); *\/   \n\n\t\/\/ filler data for form_zakaz_outer_top\n\tvar\ttitle_zakaz = $(&#039;#form_zakaz_outer_top .title_zakaz&#039;);\n\tvar\tlink_zakaz = $(&#039;#form_zakaz_outer_top .link_zakaz&#039;);\n\n\tif(title_zakaz.length &gt; 0){\n\t\ttitle_zakaz.val($.trim($(&#039;.motopress-wrapper .title-section .title-header&#039;).text()));\n\t};\n\n\tif(link_zakaz.length &gt; 0){\n\t\tlink_zakaz.val(location.href);\n\t};  \n\n\t\/\/ filler data for form_zakaz_outer_bottom\n\tvar\ttitle_zakaz = $(&#039;#form_zakaz_outer_bottom .title_zakaz&#039;);\n\tvar\tlink_zakaz = $(&#039;#form_zakaz_outer_bottom .link_zakaz&#039;);\n\n\tif(title_zakaz.length &gt; 0){\n\t\ttitle_zakaz.val($.trim($(&#039;.motopress-wrapper .title-section .title-header&#039;).text()));\n\t};\n\n\tif(link_zakaz.length &gt; 0){\n\t\tlink_zakaz.val(location.href);\n\t};\n});\n\n$( window ).load(function() {\n\n});\n\n\/\/ hide \u0431\u0443\u0441\u043f\u043b\u0430\u0442\u043d\u043e on sidebar\ndocument.querySelector(&#039;.product_list_widget .star-rating&#039;)\nvar x = document.querySelectorAll(&#039;.star-rating&#039;);\n\/\/console.log(x + &#039;====&#039;);\nfor(var i in x){\n\t\/\/if(x[i]){\n    \tx[i].parentNode.removeChild( x[i].nextSibling );\n\t\/\/}\n\n}<\/code><\/pre>\n<p>\u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u044f \u043f\u043e\u043d\u0438\u043c\u0430\u044e, \u0447\u0442\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u043e\u0431\u0430\u0441\u0442\u044f\u0445 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438. \u043d\u043e \u0441\u0430\u043c \u043d\u0435 \u043c\u043e\u0433\u0443 \u043f\u043e\u043d\u044f\u0442\u044c \u0432 \u0447\u0451\u043c \u043e\u0448\u0438\u0431\u043a\u0430, \u0430 \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u043f\u043e\u0447\u0435\u043c\u0443 \u043f\u043e\u0441\u043b\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e \u0432\u0441\u0435\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0441\u043b\u0443\u0447\u0438\u043b\u0430\u0441\u044c \u0442\u0430\u043a\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f<\/p>\n","protected":false},"template":"","class_list":["post-160949","topic","type-topic","status-closed","hentry","topic-tag-jquery"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ru.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/160949","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ru.wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/ru.wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/ru.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/160949\/revisions"}],"wp:attachment":[{"href":"https:\/\/ru.wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=160949"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}