Inside the selectmenu from https://github.com/fnagel/jquery-ui I have set a title for each option do be displayed as an icon. Working fine except the icons which filename contains white space. No icon is shown if the file name is like African Union.png
the jquery:
$('select.flags').selectmenu({
icons: [
{find: '.icon'}
],
bgImage: function() {
return 'url(' + $(this).attr("title") + ')';
}
});
html:
<option value="African Union.png" class="icon" title="/img/icons/flags/African Union.png" >African Union</option>
If I am not able to get it working inside the jQuery - How to escape the white spaces using php? Is the str_replace
the only option?