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
/** | |
* Get Cursor Position in Input Field | |
* @return integer Returns the cursor position. | |
* | |
* Source: Stackoverflow | |
* Source URI: http://stackoverflow.com/a/2897510/3107931 | |
* | |
* Usage: $('input[type="text"]').getCursorPosition() | |
*/ | |
$.fn.getCursorPosition = function() { |
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
/** | |
* Adding Full Absolute URLs to the Anchor Links in the Navbar that are not | |
* on the same page. Works best with the parent menu and sub-menu | |
* links in the navbar. And for WordPress navbar especially. | |
* | |
* Replace #parent_links_selector with the parent links selector | |
*/ | |
jQuery(document).ready(function($) { | |
$('#parent_links_selector').each(function(i, el) { |
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
.element { | |
position: relative; | |
height: 22px; | |
height: 2.2rem; | |
width: 22px; | |
width: 2.2rem; | |
} | |
.element:before, .element:after { | |
content: ''; | |
height: 1px; |
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
/* Component: Languages */ | |
.languages__item { | |
text-transform: uppercase; | |
color: #899099; | |
font-size: 13px; | |
font-size: 1.3rem; | |
line-height: 1.15; | |
} | |
.languages__item--current { | |
color: #212121; |
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 // Don't copy this line if you are inserting in a file that has it already. | |
/** | |
* ACF Options Page | |
* | |
* Instructions: | |
* Add more languages to the array below: $languages | |
* | |
* @author: Zeshan Ahmed <https://zeshanahmed.com/> | |
*/ |
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
/** | |
* | |
* Convert URLs in String to Anchor Links | |
* | |
* Help taken from: | |
* http://stackoverflow.com/a/34732417 | |
* | |
* Author: Zeshan Ahmed | |
* Author URI: http://www.zeshanahmed.com/ | |
* |
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
function runUACLCLoop() { | |
setTimeout(function() { | |
// Check if something is found on the page. | |
if ( jQuery('.class_name').is(':visible') ) { // change it to another condition | |
// Run the same function again to create the loop. | |
runUACLCLoop(); | |
// If nothing is found, then run the else statement. |
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
/** | |
* Converts XML to JSON | |
* Source: https://davidwalsh.name/convert-xml-json | |
*/ | |
function xmlToJson(xml) { | |
// Create the return object | |
var obj = {}; | |
if (xml.nodeType == 1) { // element |
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
/* Additional Styling */ | |
#bottom-arrow { | |
position: absolute; | |
width: 52px; /* Width of arrow image */ | |
height: 32px; /* Height of arrow image */ | |
left: 50%; | |
margin-left: -26px; /* Horizontally centered, should be half of the 'width' */ | |
background: url(path/to/arrow/file.png) no-repeat center center; | |
z-index: 10; | |
text-indent: -9999px; /* To visually hide the text inside the button */ |