MwyVWP ('-' * 6)
Created
May 14, 2015 07:54
-
-
Save redamoon/715ce927ada3f94feed5 to your computer and use it in GitHub Desktop.
MwyVWP
This file contains 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
<!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> |
This file contains 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 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(); |
This file contains 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
#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