(☞ຈل͜ຈ)☞ Главная  Статьи  Загрузчик Домой

Ok!
Ok!
176
В htaccess добавить 
<IfModule mod_headers.c>
  <FilesMatch ".(ttf|ttc|otf|eot|woff|woff2|font.css|css|js)$">
    Header set Access-Control-Allow-Origin "*"
  </FilesMatch>
</IfModule>
cors, allow origin100600No Access-Control-Allow-Origin header при подключении шрифтов
175
<script>
        document.addEventListener('touchstart', this.callPassedFuntion, {passive: false});
    </script>
passive, false120Про passive false
174
function find_closed() {
    //clearTimeout(typingTimer);
    //typingTimer = setTimeout(doneTyping, doneTypingInterval);
    var found;
    var tr = jQuery('.pricing tr');
    var pos = jQuery('body, html').scrollTop();
    var s = jQuery('#searchfield').val();
    //var add = jQuery('.prices').first().position().top;
    var old, i, cont;
    if(s.length > 2) {
        old = jQuery('.found_color').parents('td');
        jQuery.each(old, function(){
            cont = jQuery(this).text();
            old.text(cont);
        });
        jQuery('tr').removeClass('found');
        for (i = 0; i < tr.length; i++) {

            if (tr.eq(i).text().toLowerCase().indexOf(s.toLowerCase()) > -1) {
                tr.eq(i).addClass('opened found');
                var text = tr.eq(i).children('td:first-child').text().replace(s, '<span class=found_color>' + s + '</span>');
                //console.log(text);
                tr.eq(i).children('td:first-child').html(text);
                found = 1;
            }else{
                //tr.eq(i).remove();
                tr.eq(i).removeClass('opened');
                tr.eq(i).removeClass('found');
            }

        }
        if(jQuery('.found').length){
            var E = setTimeout(function(){
                pos += jQuery('.found').first().parents('table').position().top;
                jQuery('body, html').animate({scrollTop: pos}, 300, 'swing');
                console.log(pos);
            },300);
        }
        if (found < 1) {
            jQuery('.not-found').text('Не найдено на этой странице. Поищите через общий поиск')
        }
    }
}
найти в скрытом аккордионе12300find_closed с подстветкой
173
<?$arText = explode('#MY_COMPONENT#',$arResult['DETAIL_TEXT']);
for($i=0;$i<count($arText);$i++) {
echo $arText[$i];
if ($i>0) $APPLICATION->IncludeComponent('my:my_component','');
}?>
код в статью битрикс435Вставка кода в статью Битрикс
172
<span style="color: #999999; font-size: 10px;">Вы можете <a href="https://shop.lamaree.ru/disable_email/index.php?e=' . $su_email . '&s=' . $su_id . '" rel="noopener" style="text-decoration: underline; color: #0068A5;" target="_blank" title="отписаться">отписаться</a> от рассылки</span>
отписка от рассылки120отписка от рассылки ламаре
171
http://example.com/?_ym_debug=1
метрика, counter test, проверка12300Проверка счетчиков и событий метрики в консоли
170
/bitrix/admin/perfmon_table.php?PAGEN_1=1&SIZEN_1=20&lang=ru&table_name=b_event&by=DATE_INSERT&order=desc
битрикс, отправленные письма11020Список отправленных писем в Битрикс
169
/* javascript url кодирует сорсы всех картинок */
    var arr = document.querySelectorAll('img')

    arr.forEach(function(item, i, arr) {
        var uri = arr[i].src;
        var encoded = encodeURI(uri);
        arr[i].src = encoded;
    });
urlencode, имена картинок10090url кодировать все файлы картинок javascript
168
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );

function custom_override_checkout_fields( $fields ) {
    //unset($fields['billing']['billing_first_name']);// имя
    unset($fields['billing']['billing_last_name']);// фамилия
    unset($fields['billing']['billing_company']); // компания
    unset($fields['billing']['billing_address_1']);//
    unset($fields['billing']['billing_address_2']);//
    unset($fields['billing']['billing_city']);
    unset($fields['billing']['billing_postcode']);
    unset($fields['billing']['billing_country']);
    unset($fields['billing']['billing_state']);
    //unset($fields['billing']['billing_phone']);
    //unset($fields['order']['order_comments']);
    //unset($fields['billing']['billing_email']);
    //unset($fields['account']['account_username']);
    //unset($fields['account']['account_password']);
    //unset($fields['account']['account_password-2']);


    unset($fields['billing']['billing_company']);// компания
    unset($fields['billing']['billing_postcode']);// индекс
    return $fields;
}
woocommerce, лишние поля3400Удалить лишние поля для оформления заказа на woocommerce
167
document.addEventListener("DOMContentLoaded", function (event) {
    setTimeout(function() {
        document.querySelectorAll('*').forEach.call(
            document.querySelectorAll('img[data-src]'),
            function (img) {
                img.setAttribute('src', img.getAttribute('data-src'));
                img.onload = function () {
                    img.removeAttribute('data-src');
                };
            });
    },200);
});
отложенная, загрузка120Отложенная загрузка изображений
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27