- position: relative にした要素を子要素に持つ要素を JavaScript で非表示の状態から表示させると、その子要素が見えなくなってしまうことがある。あとで JavaScript で position の値を static にしようが、何をしようが直らない。
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
function isChecked (name) { | |
if (name instanceof Array) { | |
for (var i = name.length; 0 < i--;) { | |
if (!isChecked(name[i])) { | |
return false; | |
} | |
} | |
return true; | |
} else if (typeof name === 'string') { | |
var radios = document.getElementsByName(name); |
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 timer = false; | |
$(window).resize(function() { | |
if (timer !== false) { | |
clearTimeout(timer); | |
} | |
timer = setTimeout(function() { | |
console.log('resized'); | |
// 何らかの処理 | |
}, 200); | |
}); |
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
.foo { | |
min-height: 100px; | |
height: auto !important; | |
height: 100px; | |
} | |
.bar { | |
max-height: 200px; | |
width: expression(document.body.clientWidth > 202? "200px" : "auto"); | |
} |
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
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title>Document</title> | |
<meta name="description" content=""> | |
<meta name="keywords" content=""> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"> | |
<meta name="format-detection" content="telephone=no"> | |
<link rel="canonical" href=""> |
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
// remove "no-js" class from <html> | |
;(function () { | |
setTimeout(function () { | |
var html = document.getElementsByTagName('html')[0], | |
htmlClass = html.className, | |
newClass = htmlClass.replace(/(^| )no-js( |$)/, ' '); | |
html.className = newClass; | |
}, 0); | |
}()); |
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
<script src="https://maps.googleapis.com/maps/api/js?sensor=false"></script> | |
<script> | |
function initialize() { | |
var latlng = new google.maps.LatLng(100, 100); | |
var mapOptions = { | |
center: latlng, | |
zoom: 17, | |
scaleControl: true, | |
scrollwheel: false | |
}; |
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
#css-calc { | |
width: 10px; | |
width: calc(10px + 10px); | |
width: -webkit-calc(10px + 10px); | |
display: 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
$(window).on('touchmove.cancelScroll', function (e) { e.preventDefault(); }) |
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
$._data($("#js_debug").get(0), "events"); | |
$._data($0[0], "events"); |