A Pen by Sam Matthews on CodePen.
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
// tabletop.js is linked above | |
function init() { | |
var json = []; //prented this is a geojson and not just an array | |
Tabletop.init({ | |
key: '0AkE-VGwUGzsSdHRjTmtNMXhONjYxQUxnOV9SajY4VkE', | |
callback: function(data, tabletop) { | |
var entries = []; |
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 init() { | |
var url = 'http://api.example.com/stuffs...' | |
$.ajax({ | |
type: "GET", | |
dataType: "jsonp", | |
cache: false, | |
url: url, | |
success: function(data) { | |
console.log(data); | |
}, |
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
$(document).ready(function(){ | |
$('form').submit(function(event){ | |
var json = JSON.stringify($('form').serializeObject()); | |
$('#result').text(json); | |
return false; | |
}); | |
$.fn.serializeObject = function() { | |
var geojson = {}; | |
geojson['type'] = 'FeatureCollection'; |
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
$(document).ready(function($){ | |
$('#open').click(function(){ | |
$('#element').toggle(300).addClass('active'); | |
}); | |
$('#close').click(function(){ | |
if($('#element').hasClass('active')) { | |
$('#element').toggle(300).removeClass('active'); | |
} | |
}); | |
}); |
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
var height = $('header').height(); // element to offset scroll with (i.e. your navbar if it is fixed) | |
$('a[href*=#]').click(function() { | |
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') | |
&& location.hostname == this.hostname) { | |
var $target = $(this.hash); | |
$target = $target.length && $target | |
|| $('[name=' + this.hash.slice(1) +']'); | |
if ($target.length) { | |
var targetOffset = ($target.offset().top)-height; //offset from top based on element - this isn't required | |
$('html,body') |
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
$.ajax({ | |
type: "GET", | |
dataType: "jsonp", | |
contentType: "application/json", | |
url: 'http://geocoding.geo.census.gov/geocoder/locations/onelineaddress?address=131+Riverlawn+Ave%2C+Watertown%2C+53094&benchmark=9&format=jsonp', | |
success: function(data) { | |
console.log(data) | |
}, | |
error: function(xhr, ajaxOptions, thrownError) { | |
console.log(xhr.status, thrownError); |
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
<?php | |
// using a specified custom taxonomy slug | |
// find all taxonomy terms (categories) and | |
// the associated posts | |
$tax = 'TAXONOMY-SLUG'; | |
echo '<ul>'; | |
$terms = get_terms($tax); | |
foreach($terms as $term) { | |
echo '<li>'.$term->name; |
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
<?php // get youtube ID function | |
function get_youtube_id($url) { | |
$query_string = array(); | |
parse_str(parse_url($url, PHP_URL_QUERY), $query_string); | |
$id = $query_string["v"]; | |
return $id; | |
} |
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
#parallax-wrap { | |
height: 400px; /* anything you want/need */ | |
width: 100%; | |
position: relative; | |
display: block; | |
} | |
.parallax { | |
position:absolute; | |
width:100%; | |
height:100%; |
OlderNewer