Created
September 15, 2014 23:54
-
-
Save Ilink/6e07efb2905f907ef7d2 to your computer and use it in GitHub Desktop.
// source http://jsbin.com/yobac/2
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> | |
<script src="http://documentcloud.github.com/underscore/underscore-min.js"></script> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> | |
<meta charset=utf-8 /> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
body { | |
font-family: sans-serif; | |
} | |
.box { | |
border: 2px solid black; | |
padding: 5px; | |
width: 150px; | |
text-align: center; | |
cursor: pointer; | |
margin:10px; | |
} | |
</style> | |
</head> | |
<body> | |
<div class="box click1"> | |
Click me1 | |
</div> | |
<div class="box click2"> | |
Click me2 | |
</div> | |
<script id="jsbin-javascript"> | |
function Clicky(){ | |
this.prop1 = 1; | |
$(".click1").on('click', function(){ | |
console.log(this.prop1); | |
}); | |
} | |
var clicky = new Clicky(); | |
function Clicky2(){ | |
this.prop1 = 1; | |
function onClick(){ | |
console.log(this.prop1); | |
} | |
$(".click2").on('click', function(){}); | |
} | |
var clicky2 = new Clicky2(); | |
</script> | |
<script id="jsbin-source-html" type="text/html"><!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://documentcloud.github.com/underscore/underscore-min.js"><\/script> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"><\/script> | |
<meta charset=utf-8 /> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<div class="box click1"> | |
Click me1 | |
</div> | |
<div class="box click2"> | |
Click me2 | |
</div> | |
</body> | |
</html> | |
</script> | |
<script id="jsbin-source-css" type="text/css">body { | |
font-family: sans-serif; | |
} | |
.box { | |
border: 2px solid black; | |
padding: 5px; | |
width: 150px; | |
text-align: center; | |
cursor: pointer; | |
margin:10px; | |
}</script> | |
<script id="jsbin-source-javascript" type="text/javascript">function Clicky(){ | |
this.prop1 = 1; | |
$(".click1").on('click', function(){ | |
console.log(this.prop1); | |
}); | |
} | |
var clicky = new Clicky(); | |
function Clicky2(){ | |
this.prop1 = 1; | |
function onClick(){ | |
console.log(this.prop1); | |
} | |
$(".click2").on('click', function(){}); | |
} | |
var clicky2 = new Clicky2(); | |
</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
body { | |
font-family: sans-serif; | |
} | |
.box { | |
border: 2px solid black; | |
padding: 5px; | |
width: 150px; | |
text-align: center; | |
cursor: pointer; | |
margin:10px; | |
} |
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 Clicky(){ | |
this.prop1 = 1; | |
$(".click1").on('click', function(){ | |
console.log(this.prop1); | |
}); | |
} | |
var clicky = new Clicky(); | |
function Clicky2(){ | |
this.prop1 = 1; | |
function onClick(){ | |
console.log(this.prop1); | |
} | |
$(".click2").on('click', function(){}); | |
} | |
var clicky2 = new Clicky2(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment