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 eventHandler = { | |
handleEvent: function(ev) { | |
switch (ev.type) { | |
case 'click': | |
this.click(); | |
break; | |
case 'touchstart': | |
this.touch(); | |
break; | |
} |
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
for (var i = 1; i < 4 ; i++) { | |
var listN = eval("list_"+ i); | |
var cntN = eval("cnt_"+ i); | |
$(listN).click(function(){ | |
// ここのcntNは実行時に参照される = cntNが書き換わっているとその値を読んでしまう | |
// ので値を設定した関数を作ってあげる必要がある | |
$(cntN).animate( | |
{width: "toggle"}, | |
"fast", | |
"easeInQuart" |
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
$list: hoge dame; | |
@each $val in $list { | |
.{$val} fuga yap { | |
display: none; | |
} | |
} |
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(global, document, undefined) { | |
function Hoge() { | |
// constructor | |
return this; | |
} | |
Hoge.prototype = { | |
constructor: Hoge, |
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 SomeClassOne() { | |
this.someClassTwoInstance = new SomeClassTwo(this); | |
} | |
SomeClassOne.prototype = { | |
foo: foo, | |
bar: bar, | |
}; | |
function foo() { |
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
<link rel="import" href="../core-menu/core-submenu.html"> | |
<link rel="import" href="../core-item/core-item.html"> | |
<link rel="import" href="../core-scaffold/core-scaffold.html"> | |
<link rel="import" href="../core-header-panel/core-header-panel.html"> | |
<link rel="import" href="../core-menu/core-menu.html"> | |
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<polymer-element name="my-element"> |
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
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, minimum-scale=1, maximum-scale=1"> | |
<style> | |
</style> | |
</head> | |
<body> | |
<h2>sample1</h2> |
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 view = new Backbone.View.extend({ | |
str: 'hoge', | |
arr: [], | |
init: function() {} | |
}); | |
// 全部 __proto__ に生える | |
view.__proto__.str; // -> hoge | |
view.__proto__.arr; // -> [] | |
view.__proto__.init; // -> fn |
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 __getEnvData(ua) { | |
ua = ua.toLowerCase(); | |
var appleWebkitRE = /applewebkit/; | |
var res = { | |
isAndroid : /android/.test(ua), | |
isIOS : /ip(hone|od|ad)/.test(ua), | |
isChrome : /(chrome|crios)/.test(ua), | |
versionString: null, | |
version: null |
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
paw.js | |
====== | |
## how to use | |
### simplest use | |
``` |
OlderNewer