This file contains 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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<!-- The page title that is displayed in the top of the browser --> | |
<title></title> | |
<!-- Meta content describes your page and is indexed by search engines such as Google --> | |
<meta name="description" content="JS High Order function"> | |
<meta name="author" content="Mark Atherton"> |
This file contains 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
radioChecked = () => { | |
var allRadios = document.querySelectorAll('input[type="radio"]'); | |
allRadios.forEach(r => { | |
r.addEventListener('mouseup', function(e) { | |
if (r.checked) { | |
setTimeout(() => { | |
r.checked = false; | |
}, 0); | |
} | |
}); |
This file contains 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
$(window).resize(function() { | |
var captions = $('.module-main-links .caption'), | |
height = 0; | |
captions.each(function() { | |
var captionHeight = $(this).outerHeight(); | |
if (captionHeight > height) { | |
height = captionHeight; | |
} | |
}); |
This file contains 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
$(window).resize(function() { | |
//var viewportWidth = $(window).width(); jQuery selector has inconsistencies with Media Queries | |
var viewportWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; // JS better consistency with Media Queries | |
/*Mobile view*/ | |
if (( viewportWidth <= 600 ) || ( viewportWidth > 776 ) && (viewportWidth < 921)) { | |
//Setup Markup to add attribute requirements for mobile | |
console.log( "on mobile" ); | |
} | |
/*Descktop view */ | |
else { |
This file contains 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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Progress bar demo</title> | |
<meta name="description" content="vanilla progress bar"> | |
<meta name="author" content="Mark Atherton"> |
This file contains 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
if (document.URL.indexOf("PAGE-NAME") >= 0) { | |
$('a[href="/page-name"]').hide(); | |
} | |
/* | |
= is exactly equal | |
!= is not equal | |
^= is starts with | |
$= is ends with | |
*= is contains |
This file contains 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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |
<title>Email</title> | |
<style> | |
/*desktop css*/ |
This file contains 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 () { | |
if (navigator.userAgent.indexOf('MSIE 8.0') > 0 ) { | |
var $formControl = $('select.form-control:first'); | |
if ($formControl.length > 0) { | |
$formControl.before('<select class="form-control" style="display:none"></select>'); | |
} | |
} | |
}()); |
This file contains 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
ul.dropdown ul li { display: inline; width: 100%; } |
NewerOlder