Show one of two strings based on a condition. Clickability optional.
bower install --save jifalops/text-toggle
See full demo for examples using Polymer.
1. Show text based on outside condition.<br/>
<button onclick="toggle();">Toggle</button>
<text-toggle id="reader" t="true" f="false"></text-toggle>
<br/><br/>
2. Using element as control.
<text-toggle click-events t="true" f="false"></text-toggle>
<br/><br/>
3. As an HTML anchor.
<text-toggle link t="true" f="false"></text-toggle>
<br/><br/>
4. Chaging an outside condition.
<text-toggle id="writer" link t="true" f="false" onclick="setTimeout(read());"></text-toggle>
<br/><br/>
Full demo: webcomponents.org | github.
API: webcomponents.org | github.
- Fork it on Github.
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request