ソース掲示板




すべてから検索

キーワード   条件 表示 現行ログ 過去ログ トピックス 名前 本文

  メンテナンス 前画面に戻る

対象スレッド 件名: Three.js のクラス定義を参考にしたクラス定義サンプル
名前: lightbox
処理選択
パスワード

件名 Three.js のクラス定義を参考にしたクラス定義サンプル
名前 lightbox
コメント
@DIV
<!doctype html>
<html lang="en">
	<head>
		<title>サンプル</title>
		<meta charset="utf-8">
		<style>
		</style>
	</head>

<body>
<script>
var R101 = {};
R101.Class = function(){
	this.version = "1.01";
	this.colors = [];
	this.flg = false;
};
R101.Class.prototype = {
	constructor: R101.Class,
	method1: function() {
		alert("method1:"+this.version);
	},
	method2: function() {
		alert("method2:"+(this.data||"未定義です"));
	},
	method3: function() {
		alert("method3:"+this.flg);
		this.data = {};
	}
}

var obj = new R101.Class();

</script>

<input type="button" value="method1" onclick="obj.method1();" />
<input type="button" value="method2" onclick="obj.method2();" />
<input type="button" value="method3" onclick="obj.method3();" />
</body>
</html>
@END