Skip to content

Instantly share code, notes, and snippets.

View Tabpanel-using-Knockout.js.markdown
View _namespace-memo.js
if (!window.namespace) {
var namespace = {};
}
(function(namespace){
namespace.FunctionName = function(){
this.load();
};
View Grunt_Install_memo.markdown

Init

npm init

Install Grunt

sudo npm install grunt --save-dev
@e-river
e-river / _toggleClass.js
Last active Aug 29, 2015
Add / Remove class without using jQuery
View _toggleClass.js
/*
* This code is to add or remove class depends on the direction like Smartphone.
* The classname is 'isActive'.
*/
function toogleClass(){
this.node = document.querySelector(target);
}
toogleClass.prototype.init = function(){
var self = this;
@e-river
e-river / _scrolltop_accordion.js
Created Jul 24, 2014
Accordion with scrolltop using Zepto.js
View _scrolltop_accordion.js
Zepto(function($){
var acc = new Accordion();
acc.init();
});
function Accordion(){
this.toggle = $('.mod-accordion_heading_toggle');
this.panel = $('.mod-accordion_panel');
}
Accordion.prototype.init = function(){
@e-river
e-river / PointerEvents.js
Last active Aug 29, 2015
PointerEvents for less than IE10
View PointerEvents.js
$(function(){
var pointer = new PointerEvent();
pointer.load();
});
function PointerEvent(){
this.userAgent = window.navigator.userAgent.toLowerCase();
this.appVersion = window.navigator.appVersion.toLowerCase();
this.target = $('.cp-image');
this.pointer = $('.click-shield');
View aria-desc.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View Speech-Synthesis-Demo.markdown
@e-river
e-river / animation.scss
Last active Aug 29, 2015
Mixin for CSS Animation
View animation.scss
// =========== [[CSS Animation]] ===========
// Keyframes
// Usage:
// @include keyframes(name) {
// 0% { selector { property: value; } }
// 100% { selector { property: value; } }
// }
@mixin keyframes($name) {
@-webkit-keyframes #{$name} {
View prefetch.jade
- var links = ['//www.google-analytics.com', '//accounts.google.com', '//apis.google.com', '//oauth.googleusercontent.com', '//ssl.gstatic.com', '//www.facebook.com', '//connect.facebook.net', '//static.ak.facebook.com', '//static.ak.fbcdn.net', '//s-static.ak.facebook.com', '//twitter.com', '//cdn.api.twitter.com', '//p.twitter.com', '//platform.twitter.com', '//b.st-hatena.com', '//cdn-ak.b.st-hatena.com', '//cdn.api.b.hatena.ne.jp']
each val in links
link(href='#{val}', rel='dns-prefetch')
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.