Skip to content

Instantly share code, notes, and snippets.

@reiniertromp
Created June 6, 2014 14:49
Show Gist options
  • Select an option

  • Save reiniertromp/5cbfb41fc4021768d6c2 to your computer and use it in GitHub Desktop.

Select an option

Save reiniertromp/5cbfb41fc4021768d6c2 to your computer and use it in GitHub Desktop.
<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