Directory

← Back

text-toggle

Show one of two strings based on a condition. Clickability optional.

Author

Contributors

Rating

[ This description is mirrored from README.md at github.com/jifalops/text-toggle on 2019-05-10 ]

Published on webcomponents.org

text-toggle

Show one of two strings based on a condition. Clickability optional.

Installation

bower install --save jifalops/text-toggle

Demo

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.

Contributing

  1. Fork it on Github.
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request

License

MIT

Compatibility

(Loading compatibility data...)

Was this helpful? Need more help?
Leave a comment or a question below. You can also join the chat on Discord or ask questions on StackOverflow.

Version

Dependencies

  • polymer#Polymer/polymer#^2.0.0
Released
2017-07-13
Maturity
IMPORTED
License
MIT License

Compatibility

Framework
Polymer 2.0+
Browser
Browser Independent
Online