Skip to content

Instantly share code, notes, and snippets.

View teddykishi's full-sized avatar
💭
I may be slow to respond.

Teddy Kishi teddykishi

💭
I may be slow to respond.
View GitHub Profile
@teddykishi
teddykishi / gist:dfb4ddc8f2d8c89a8447
Created July 14, 2014 13:38
Get list of data attributes using with jQuery
(function($) {
$.fn.allData = function(){
var elements = [], data;
this.each(function(){
data = $(this).data();
elements.push(data);
});
return this.length === 1 ? elements[0] : elements;
}
})(jQuery);
<!DOCTYPE html>
<meta charset=utf-8>
<meta name=viewport content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name=apple-mobile-web-app-capable content=yes>
<meta name=apple-mobile-web-app-status-bar-style content=black>
<title>Test fullscreen</title>
<style>
html, body {
margin: 0;
padding: 0;