All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
,elem.offsetTop
,elem.offsetWidth
,elem.offsetHeight
,elem.offsetParent
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# coding: utf8 | |
# скрипт мониторит температуру, и с помощью ШИМ управляет | |
# GPIO пином (0-3В), который должен быть подключен на базу транзистора, | |
# который является ключем в цепи питания вентилятора (5В). | |
# пример подключения вентилятора через ключ: | |
# https://easyeda.com/b4tman.p2p/rpi-fan-01 | |
# параметры: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'acf/init', 'nd_acf_add_local_field_groups' ); | |
/** | |
* Add Advanced Custom Fields programatically (Repeater field). | |
* | |
* @link https://www.advancedcustomfields.com/resources/register-fields-via-php/ | |
* @link https://support.advancedcustomfields.com/forums/topic/register-two-locations-via-php-doesnt-work/ | |
* @link https://support.advancedcustomfields.com/forums/topic/adding-additional-layout-to-flexible_content-field-in-child-theme/ | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var l=['keydown','keypress','keyup','fullscreenerror','resize','scroll','submit','copy','paste','mouseover','mousemove','mousedown','mouseup','auxclick','click','dblclick','contextmenu','wheel','mouseleave','mouseout','select','pointerlockchange','pointerlockerror','drag','dragend','dragenter','dragover','dragleave','drop'],a=false; | |
dfwp_unregister = function(){ | |
l.map(function(el){window.removeEventListener(el,dfwp_initGtm)}); | |
}; | |
dfwp_initGtm = function(){ | |
if (!a){ | |
a=true; | |
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': | |
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], | |
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Heavily borrowed from: http://xplus3.net/2010/08/08/filtering-on-a-non-standard-database-field-with-wordpress/ | |
**/ | |
class CoordinatesTable extends DB { | |
protected $db_option = "coordinates_db"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.acf-fc-popup .preview { | |
position: absolute; | |
right: 100%; | |
margin-right: 0px; | |
top: 0; | |
background: #383c44; | |
min-height: 100%; | |
border-radius: 5px; | |
align-content: center; | |
display: grid; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"vars": { | |
"account": "account_name", | |
"profile": "profile_name", | |
"visitor_id": "CLIENT_ID(AMP_ECID_GOOGLE)", | |
"gclid": "${queryParam(gclid)}" | |
}, | |
"extraUrlParams": { | |
"page_name": "home page for company x", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* GTM : use the following code inside a customTask, hitCallback oder a cleanup tag | |
GA.JS : modify your existing tracking code with a customTask or hitCallback and execute the following code | |
GTAG.JS : modify your existing tracking code with a manual page_view event | |
including an event_callback (gtag.js) and execute the following code | |
customTask ga.js - see: https://developers.google.com/analytics/devguides/collection/analyticsjs/tasks#adding_to_a_task | |
hitCallback ga.js - see: https://developers.google.com/analytics/devguides/collection/analyticsjs/sending-hits#hitcallback | |
event_callback gtag.js - see: https://developers.google.com/analytics/devguides/collection/gtagjs/sending-data#implement_event_callback_functions | |
*/ |
OlderNewer