A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.
One-line version to paste in your DevTools
Use $$
if your browser aliases it:
~ 108 byte version
//26-5-2020 update: possibly shorter, and better, since 'click' now fires on a tap, and is not prevented by the previous script. | |
//Also: more concatenation. | |
$(document).on('touchstart, click', 'a.taphover', function (e) { | |
if (!$(this).hasClass('hover')) { e.preventDefault(); } | |
$('.taphover').not($(this).toggleClass('hover')).removeClass('hover'); | |
}); | |
//the previous version: | |
//taphover - a solution to the lack of hover on touch devices. |
/** | |
* Smart Append Selectors | |
* | |
* @param {string} $name - Name of the Tag | |
* @param {string|bool} $mod - Name of the modifier | |
* @param {bool} $context - For nested selector | |
* @param {string} $name - Name from the Tag | |
*/ | |
@mixin append($tag, $mod: false, $context: false) { | |
<?php | |
//My ACF Fields for reference | |
//testimonials - field group | |
//testimonial - sub-field | |
//testimonial_header - sub-field | |
//First Repeater Row in Array | |
$rows = get_field( 'testimonials', 348 );// grab all rows from page ID |
<!-- Include jQuery from somewhere, must use version 1.8 or above --> | |
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> | |
<!-- Include latest jquery.scrollTo, can download from https://github.com/flesler/jquery.scrollTo/releases --> | |
<script type="text/javascript" src="//cdn.jsdelivr.net/jquery.scrollto/2.1.2/jquery.scrollTo.min.js"></script> | |
<!-- Initialize the plugin, the contents of the script can be inlined here, of course --> | |
<script type="text/javascript" src="js/init.js"></script> |
/* bling.js */ | |
window.$ = document.querySelector.bind(document); | |
window.$$ = document.querySelectorAll.bind(document); | |
Node.prototype.on = window.on = function(name, fn) { this.addEventListener(name, fn); }; | |
NodeList.prototype.__proto__ = Array.prototype; | |
NodeList.prototype.on = function(name, fn) { this.forEach((elem) => elem.on(name, fn)); }; |
function updateheight(){ | |
_.parents('.slick-list').height(_.parents('.chapters_slide.slick-active').height()); | |
} | |
$(".featured-slider-nav").each(function(index) { | |
$(this).click(function() { | |
_ = $(this); |
<?php | |
class IncludeRawExtension extends \Twig_Extension | |
{ | |
public function getFunctions() | |
{ | |
return [ | |
new \Twig_SimpleFunction( | |
'includeRaw', | |
[$this, 'includeRaw'], |
values = | |
locale_country_code: [ | |
{ title: "Andorra", value: "AD" }, | |
{ title: "United Arab Emirates", value: "AE" }, | |
{ title: "Afghanistan", value: "AF" }, | |
{ title: "Antigua and Barbuda", value: "AG" }, | |
{ title: "Anguilla", value: "AI" }, | |
{ title: "Albania", value: "AL" }, | |
{ title: "Armenia", value: "AM" }, | |
{ title: "Angola", value: "AO" }, |
Include a directory in your Theme folder with the name `wp-config` and include here the File for your Environment. |