arielsalminen / TinyNav.js

Responsive navigation plugin that weighs just 443 bytes
http://tinynav.viljamis.com/
635 stars 207 forks source link

Insert an optional "label" tag before the "select" tag #23

Closed larcher closed 12 years ago

larcher commented 12 years ago

To make the select more accessible, it helps to add a label tag. I added it as another option in the settings object.

Use the option like this:

jQuery(".menu").tinyNav({ label: 'Table of Contents' });

which creates HTML that looks something like this:

<label class="tinynav tinynav1" for="tinynav1">Table of Contents</label>
<select id="tinynav1" class="tinynav tinynav1">
    <option value="...">...</option>
    ...
</select>