Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tooltip option #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

eiling
Copy link

@eiling eiling commented May 31, 2022

Add an option to include tooltips using the 'title' attribute

The tooltip option value can be either 'value' or 'text' and corresponds to which attribute of the option will be used for the tooltip.

Examples:

<select name="languagejs">
  <option value="ru">Russian</option>
  <option value="fr">French</option>
  <option value="pt">Portuguese</option>
  <option value="zh">Chinese</option>
</select>
<script>
cuteform($('select[name=languagejs]'), {
  'tooltip': 'value',  // results in title="ru"
  'images': {
    'ru': 'images/ru.png',
    'fr': 'images/fr.png',
    'pt': 'images/pt.png',
    'zh': 'images/zh.png',
  }
});
</script>
<select name="languagejs">
  <option value="ru">Russian</option>
  <option value="fr">French</option>
  <option value="pt">Portuguese</option>
  <option value="zh">Chinese</option>
</select>
<script>
cuteform($('select[name=languagejs]'), {
  'tooltip': 'text',  // results in title="Russian"
  'images': {
    'ru': 'images/ru.png',
    'fr': 'images/fr.png',
    'pt': 'images/pt.png',
    'zh': 'images/zh.png',
  }
});
</script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant