Created
June 6, 2014 14:49
-
-
Save reiniertromp/5cbfb41fc4021768d6c2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| <polymer-element name="imagine-house" attributes="url" noscript> | |
| <template> | |
| <style> | |
| :host { | |
| display: inline-block; | |
| padding: 50px; | |
| } | |
| :host(:hover) { | |
| background: green; | |
| } | |
| img { | |
| margin: 20px; | |
| width: 200px; | |
| padding: 10px; | |
| } | |
| img:hover { | |
| background: red; | |
| } | |
| h1 { | |
| text-align: center; | |
| } | |
| </style> | |
| <span><img on-click="{{ increaseCount }}" src="{{url}}"></span> | |
| <h1>{{ count }}</h1> | |
| </template> | |
| <script> | |
| Polymer('imagine-house', { | |
| count: 0, | |
| increaseCount: function(){ | |
| this.count = this.count + 1; | |
| }, | |
| imageList: [ | |
| {imageUrl: 'http://www.ervas.nl/sites/ervas/files/resize/gevelrenovatie/flat%20tekening-300x203.jpg'}, | |
| {imageUrl: 'http://imgs.steps.dragoart.com/how-to-draw-a-house-for-kids-step-8_1_000000058125_5.jpg'}, | |
| {imageUrl: 'http://www.gescosoftwareengineering.nl/Diversen/Kleurplaten/Soorten/Boerderij/boerderij053.jpg'} | |
| ] | |
| }); | |
| </script> | |
| </polymer-element> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment