TinyNav.js
TinyNav.js copied to clipboard
Enhancement: string replace option
First and foremost, thanks for sharing TinyNav.js with the GitHub community, it's a great plugin!
Since I needed something to format the textNode of the <option>
elements I extended tinyNav.js with a replace
option. It works as follows:
$('.nav-filter').tinyNav({
active: 'selected',
replace: {
regex: /\d{1,3}/,
fn: function (nr) {
return '(' + nr + ')';
}
}
});
Basically it's a simple way to modify the content before it's gets injected in the DOM. If you want to...I could do a pull request. Just let me know.
Cheers