javascript - Toggling between two divs using Polymer -
i ran issue using polymer toggle through 2 divs, problem have is, want use polymer standard of toggling use: hidden?="{{toggleme}}" attribute on div , bind make function toggling or show/hide this:
<div hidden?="{{divone}}">test</div> <div hidden?="{{divtwo}}">test2</div>  <a on-tap="{{change}}">toggle</a>  <script> polymer('componentname',{   change: function(){    this.divone = !this.divone;    this.divtwo = !this.divtwo;   } }) </script>   this above show both , hide both together, want 1 displayed , other hidden, switching between 2 while starting 1 hidden , other active, , swapping states there.
i tried no luck can't or use '!' on left hand side:
!this.divone = this.divone; this.divtwo = !this.divtwo;   thanks reading
this.divone = !(this.divtwo = this.divone);
Comments
Post a Comment