Skip to content

Instantly share code, notes, and snippets.

@tomswatermelon
tomswatermelon / heifont.css
Last active August 29, 2015 13:56
Standard Chinese web fonts in Hei css
font-family: "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
@tomswatermelon
tomswatermelon / gist:9580394
Created March 16, 2014 08:58
Webkit scrollbar customization
/* For the "inset" look only */
html {
overflow: auto;
}
body {
position: absolute;
top: 20px;
left: 20px;
bottom: 20px;
right: 20px;
@tomswatermelon
tomswatermelon / jsFullscreen.js
Last active August 29, 2015 13:57
Javascript fullscreen button example
//fullscreen
function launchFullScreen(element) {
console.log('go fl');
if (element.requestFullscreen) {
element.requestFullscreen();
}
else if (element.mozRequestFullScreen) {
element.mozRequestFullScreen();
}
else if (element.webkitRequestFullscreen) {
@tomswatermelon
tomswatermelon / isOdd.js
Last active August 29, 2015 13:57
Determine if a number is Odd
function isOdd(num) { return num % 2;}
@tomswatermelon
tomswatermelon / jsRounding.js
Last active August 29, 2015 14:00
Rounding in Javascript
Math.round(123.567);
@tomswatermelon
tomswatermelon / webfonts.css
Last active October 6, 2021 14:28
Webfonts CSS
/*Roboto*/
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 100;
src: local('Roboto Thin'), local('Roboto-Thin'), url(fonts/Roboto-Thin.ttf) format('truetype');
}
@font-face {
font-family: 'Roboto';
font-style: normal;
@tomswatermelon
tomswatermelon / 0_reuse_code.js
Last active August 29, 2015 14:07
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@tomswatermelon
tomswatermelon / nooverscroll.css
Created March 11, 2016 14:23
Preventing Overscroll
html, body {
width: 100%;
height: 100%;
overflow: hidden;
}
body > div {
height: 100%;
overflow: scroll;
-webkit-overflow-scrolling: touch;