Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@redamoon
Created May 14, 2015 07:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save redamoon/715ce927ada3f94feed5 to your computer and use it in GitHub Desktop.
Save redamoon/715ce927ada3f94feed5 to your computer and use it in GitHub Desktop.
MwyVWP
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>test code</title>
</head>
<body>
<div id="hogehoge">クリックエリア</div>
<br>
<div id="hogehoge_s">クリックエリア2</div>
<script src="https://code.jquery.com/jquery-1.11.3.js"></script>
</body>
</html>
function IDEACD(_target ,test){
this.target = _target;
this.comment = test;
}
IDEACD.prototype._globalClick = function(){
console.log(this.comment);
var hogehoge = this.comment;
$(this.target).click(function(){
alert(hogehoge);
});
};
var Click01 = new IDEACD('#hogehoge','test');
var Click02 = new IDEACD('#hogehoge_s','foo');
Click01._globalClick();
Click02._globalClick();
#hogehoge{
cursor: pointer;
}
#hogehoge_s{
cursor: pointer;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment