Skip to content

Instantly share code, notes, and snippets.

@helloGoGo
helloGoGo / dom_observer.html
Last active March 30, 2017 09:19
MutationObserver
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8" />
<title>MutationObserver</title>
<script src="dom_observer.js"></script>
</head>
<body>
<input type="button" value="Hello" onclick="appendTextNode()"/>
<div id="text-container"></div>
@helloGoGo
helloGoGo / trim.html
Last active March 21, 2017 15:39
入力値から前後の空白を削除してフィールドに再セット
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>trim</title>
<!--jQuery-->
<script src="../library/jquery/jquery-3.1.1.min.js"></script>
<script>
$(function(){
/**
@helloGoGo
helloGoGo / text-inden.html
Last active March 13, 2017 15:58
cssで字下げ表示
<!DOCTYPE html>
<html>
<head>
<style>
p {
padding-left: 1em;
text-indent: -1em;
}
</style>
</head>
@helloGoGo
helloGoGo / tooltip.html
Last active March 11, 2017 16:44
jQueryを使用してツールチップを表示する
<style type="text/css">
.tooltip {
display: none;
}
#tooltip-showing {
display: none;
padding: 15px;
width: 200px;
text-align: left;
overflow: hidden;
@helloGoGo
helloGoGo / hoge_fuga_dialog.html
Created March 8, 2017 16:40
"common_dialog.js"を使用したダイアログ表示
<script>
$(function() {
$('#open_hoge_dialog').click(function() {
HogeFugaDialog.open(this.id);
});
$('#open_fuga_dialog').click(function() {
HogeFugaDialog.open(this.id);
});
});
</script>
@helloGoGo
helloGoGo / common_dialog.js
Created March 8, 2017 16:39
ダイアログの表示制御を行う共通オブジェクト
/**
* ダイアログの表示制御を行う共通オブジェクト
*/
var CommonDialog = {
/**
* 表示対象のダイアログIDを格納する
* @type {string}
*/
dialogId : '',
@helloGoGo
helloGoGo / http.js
Last active March 8, 2017 07:04
Deferredを用いたajax共通オブジェクト
var getData = function (query) {
var param = {
url: 'http://hoge',
data: {
userId : 'hoge'
query: query,
},
dataType: 'json'
}
//success