Created
June 10, 2017 07:39
-
-
Save tkreis/791fb9845ad4859dd53eb67f63205882 to your computer and use it in GitHub Desktop.
Web component test
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><hello-world></title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.5.4/react.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.5.4/react-dom.js"></script> | |
<!-- Imports polyfill --> | |
<script src="../webcomponentsjs/webcomponents.min.js"></script> | |
<!-- Imports custom element --> | |
<script rel="import" src="hello-world.js"> </script> | |
</head> | |
<body> | |
<!-- Runs custom element --> | |
<touchy-touch id="toucher" onScroll="onScroll();"></touchy-touch> | |
<script> | |
function onScroll () { | |
console.log('scroll', arguments) | |
} | |
document.addEventListener("DOMContentLoaded", function() { | |
document.getElementById('toucher').addEventListener('select', function () { | |
console.log('select', arguments); | |
}) | |
document.getElementById('toucher').addEventListener('close', function () { | |
console.log('close', arguments); | |
}) | |
}); | |
</script> | |
</body> | |
</html> |
Author
tkreis
commented
Jun 10, 2017
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment