-
-
Save krizpoon/abbc7356af144bb0a714 to your computer and use it in GitHub Desktop.
Common Javascript / HTML snippets
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
var is_iOS = /(iPad|iPhone|iPod)/g.test(navigator.userAgent); | |
var isAndroid = /Android/gi.test(navigator.userAgent); |
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
body, td, input, select, textarea { | |
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; | |
} |
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
@keyframes rotating | |
{ | |
from | |
{ | |
transform: rotate(0deg); | |
-ms-transform: rotate(0deg); | |
-moz-transform: rotate(0deg); | |
-webkit-transform: rotate(0deg); | |
-o-transform: rotate(0deg); | |
} | |
to | |
{ | |
transform: rotate(360deg); | |
-ms-transform: rotate(360deg); | |
-moz-transform: rotate(360deg); | |
-webkit-transform: rotate(360deg); | |
-o-transform: rotate(360deg); | |
} | |
} | |
@-webkit-keyframes rotating /* Safari and Chrome */ | |
{ | |
from | |
{ | |
transform: rotate(0deg); | |
-ms-transform: rotate(0deg); | |
-moz-transform: rotate(0deg); | |
-webkit-transform: rotate(0deg); | |
-o-transform: rotate(0deg); | |
} | |
to | |
{ | |
transform: rotate(360deg); | |
-ms-transform: rotate(360deg); | |
-moz-transform: rotate(360deg); | |
-webkit-transform: rotate(360deg); | |
-o-transform: rotate(360deg); | |
} | |
} | |
.rotating | |
{ | |
-webkit-animation: rotating 1s linear infinite; | |
-moz-animation: rotating 1s linear infinite; | |
-ms-animation: rotating 1s linear infinite; | |
-o-animation: rotating 1s linear infinite; | |
animation: rotating 1s linear infinite; | |
} |
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
<!-- jQuery --> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> | |
<!-- jQuery Mobile --> | |
<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jquerymobile/1.4.3/jquery.mobile.min.css" /> | |
<script src="//ajax.googleapis.com/ajax/libs/jquerymobile/1.4.3/jquery.mobile.min.js"></script> | |
<!-- jQuery UI --> | |
<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/themes/smoothness/jquery-ui.css" /> | |
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/jquery-ui.min.js"></script> |
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
.noselect { | |
-webkit-touch-callout: none; | |
-webkit-user-select: none; | |
-khtml-user-select: none; | |
-moz-user-select: none; | |
-ms-user-select: none; | |
user-select: none; | |
} |
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
// listen on resize event | |
$(window).resize(function() | |
{ | |
// trigger layout event on dynamic-layout elements | |
$('.dynamic-layout').trigger('layout'); | |
}).resize(); | |
// for dynamic-layout elements, register layout handler | |
$(elem).addClass('dynamic-layout').on('layout', 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
_ |
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
<meta charset="UTF-8"> |
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
<meta name="viewport" content="width=device-width, user-scalable=no"> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment