Skip to content

Add tooltip option - #2

Open
eiling wants to merge 1 commit into
db0company:masterfrom
eiling:feature/tooltip
Open

Add tooltip option#2
eiling wants to merge 1 commit into
db0company:masterfrom
eiling:feature/tooltip

Conversation

@eiling

@eiling eiling commented May 31, 2022

Copy link
Copy Markdown

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