First, reference 'legacy' jQuery version:
<script src="jquery.1.10.2.js"></script>
Do any necessary legacy jQuery stuff, and anything that is not version-dependent:
$(function () { | |
// Hide the extra content initially (or could be done using css / inline style attribute) | |
$('.more-content').hide(); | |
// Add 'show more' text beneath the main content | |
$(".more-less").append('<div class="adjust" style="cursor:pointer">Show more \u25bc</div>'); | |
// Show hidden content when 'show more' selected | |
$('.more-less').on('click', '.adjust', function (e) { | |
$(this).siblings('.more-content').slideToggle(); | |
// Change to 'show less' when extra content is visible | |
($(this).text() === 'Show more \u25bc') ? $(this).text('Show less \u25b2') : $(this).text('Show more \u25bc'); |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |
<!-- Enable responsive view on mobile devices --> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>Responsive tiled photo gallery in pure CSS</title> | |
// Handle Chrome date validation 'bug' | |
jQuery.validator.addMethod('date', function (value, element) { | |
jQuery.culture = Globalize.culture("en-GB"); | |
var date = Globalize.parseDate(value, "dd/MM/yyyy", "en-GB"); | |
return this.optional(element) || !/Invalid|NaN/.test(new Date(date).toString()); | |
}); |
// Dynamic filtering of page content | |
// Wrap content to be filtered in #contentToFilterContainer element | |
// Add data-filter attributes with keywords for each (child) item to be filtered | |
var contentToFilterContainer = jQuery('#contentToFilterContainer'); | |
var keyupTimer; | |
var filterCaption = (!!contentToFilterContainer.data('filtercaption') ? contentToFilterContainer.data('filtercaption') : 'Search page'); | |
contentToFilterContainer.before('<label for="filterText">' + | |
filterCaption + | |
'</label><input type="text" id="filterText" class="content-filter" title="start typing here to filter content on the page" data-tooltip />' |
// Example usage: | |
// $("#EstablishmentTree").jstree({ | |
// // other jstree properties ... | |
// "sort": // function sort(a, b) { ... } | |
// }); | |
function sort(a, b) { | |
// For jsTree, use get_text() to get node text: | |
// var textA = this.get_text(a), textB = this.get_text(b); |
$('a[href*="<EXTERNAL URL>"]').each(function(){$(this).after(" <span class='external-link'>(external link)</span>")}); |
/* Creates extra-large ordered list numbering */ | |
.bignum { | |
margin-left: 0; | |
counter-reset: listItem; | |
} | |
.bignum>li { | |
list-style: none; | |
position: relative; |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Skip to content</title>
<style>
#skiptocontent a {
padding: 6px;