Skip to content

Instantly share code, notes, and snippets.

@ivcreative
ivcreative / iframe-content.css
Created July 13, 2024 21:57 — forked from erkobridee/iframe-content.css
set focus to an iframe after loads its content
// hack to enable touch after focus on the iframe
html,
body {
touch-action: auto;
}
@ivcreative
ivcreative / form-content.html
Created July 12, 2024 12:39 — forked from alexmustin/form-content.html
WordPress AJAX Live Search of Post Title
<!-- // The HTML (could be part of page content) // -->
<input type="text" name="keyword" id="keyword" onkeyup="fetch()"></input>
<div id="datafetch">Search results will appear here</div>
@ivcreative
ivcreative / add-unfiltered_html-capability-to-admins-or-editors.php
Created April 29, 2022 18:52 — forked from kellenmace/add-unfiltered_html-capability-to-admins-or-editors.php
Add unfiltered_html Capability to Admins or Editors in WordPress Multisite
<?php
/**
* Enable unfiltered_html capability for Editors.
*
* @param array $caps The user's capabilities.
* @param string $cap Capability name.
* @param int $user_id The user ID.
* @return array $caps The user's capabilities, with 'unfiltered_html' potentially added.
*/
@ivcreative
ivcreative / accessible-menu.css
Created October 1, 2021 14:42 — forked from AllThingsSmitty/accessible-menu.css
Accessible dropdown menu
/* Top level nav */
.nav {
float: left;
margin: 20px 0;
}
/* Dropdowns */
.nav ul {
position: absolute;
top: 2.5em;
// config
$_color-base-grey: rgb(229,231,234);
$palettes: (
purple: (
base: rgb(42,40,80),
light: rgb(51,46,140),
dark: rgb(40,38,65)
),
grey: (
base: $_color-base-grey,
@ivcreative
ivcreative / vanilla-cookies.js
Created November 18, 2020 15:58 — forked from billiegoose/vanilla-cookies.js
Vanilla Cookies - a dead simple yet full-featured JavaScript cookie library
// Vanilla Cookies - a dead simple yet full-featured JavaScript cookie library
// derived from http://stackoverflow.com/a/19189846
/*********************************************************
Gets the value of a cookie.
**********************************************************/
getCookie = function(sName)
{
var oCrumbles = document.cookie.split(';');
for(var i=0; i<oCrumbles.length;i++)
@ivcreative
ivcreative / flexbox.scss
Created May 1, 2020 13:26 — forked from richardtorres314/flexbox.scss
CSS Flexbox - Sass Mixins
// --------------------------------------------------
// Flexbox SASS mixins
// The spec: http://www.w3.org/TR/css3-flexbox
// --------------------------------------------------
// Flexbox display
@mixin flexbox() {
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
@ivcreative
ivcreative / bookmark.js
Created February 18, 2020 15:56 — forked from oilvier/bookmark.js
Javascript to add a bookmark - Cross Browser
/**
*
* Add to bookmark
* Several tests are necessary in order for this "simple" action to work in most of the browsers
*
*/
// First, we define the element where the "Add to bookmark" action will trigger
var triggerBookmark = $(".js-bookmark"); // It must be an `a` tag
@ivcreative
ivcreative / index.html
Created October 2, 2019 23:28 — forked from A973C/index.html
A CodePen by A973C. Horizontal Portfolio Layout with CSS3 Animations and jQuery - Demo for my blog post: http://blog.sarasoueidan.com/horizontal-portfolio-layout
<header>
<a href="http://blog.sarasoueidan.com/horizontal-portfolio-layout">Read Tutorial</a>
</header>
<div class="demo-wrapper">
<!-- <h1>Horizontal Portfolio Layout With CSS3 Animations and jQuery</h1> -->
<ul class="portfolio-items">
<li class="item">
@ivcreative
ivcreative / Featured Image Instructions
Created August 10, 2019 14:35 — forked from spencejs/Featured Image Instructions
Add Instruction Text To Featured Image Box In Wordpress Admin