Skip to content

Instantly share code, notes, and snippets.

@crysfel
Created May 11, 2015 18:38
Show Gist options
  • Save crysfel/c8c76395413912c64461 to your computer and use it in GitHub Desktop.
Save crysfel/c8c76395413912c64461 to your computer and use it in GitHub Desktop.
Web Component Custom Logic
close = root.querySelector('.panel-buttons span.collapse'); //step 1
close.addEventListener('click',function(){ //Step 2
var body = root.querySelector('.panel-body');
if(body.style.display === 'none'){
body.style.display = 'block'
}else{
body.style.display = 'none';
}
},false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment