Skip to content

Instantly share code, notes, and snippets.

$list: hoge dame;
@each $val in $list {
.{$val} fuga yap {
display: none;
}
}
@dameleon
dameleon / gist:4522253
Last active December 11, 2015 01:18
非同期的なアレ
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"
@dameleon
dameleon / gist:4249010
Created December 10, 2012 07:21
handleEvent
var eventHandler = {
handleEvent: function(ev) {
switch (ev.type) {
case 'click':
this.click();
break;
case 'touchstart':
this.touch();
break;
}