jQuery-UI iconselectmenu Not Working
Hello, i'm trying to use the selector jquery from the website of jquery ui.
I use the code but not work on my page.
This is my code:
- <html>
- <head>
- <title>EXAMPLE</title>
- <script type="text/javascript" src="
//code.jquery.com/jquery-1.10.2.js
"></script>
- <script type="text/javascript" src="
//code.jquery.com/ui/1.11.2/jquery-ui.js
"</script>
- <link rel="stylesheet" href="//jquery-ui.css" />
- <script type="text/javascript">
- $(function(){
- $.widget( "custom.iconselectmenu", $.ui.selectmenu, {
_renderItem: function( ul, item ) {
var li = $( "<li>", { text: item.label } );
if ( item.disabled ) {
li.addClass( "ui-state-disabled" );
}
$( "<span>", {
style: item.element.attr( "data-style" ),
"class": "ui-icon " + item.element.attr( "data-class" )
})
.appendTo( li );
return li.appendTo( ul );
}
});
$( "#lang" ).iconselectmenu().iconselectmenu( "menuWidget" ).addClass( "ui-menu-icons customicons" );
- });
- </script>
- <style>
- #lang {
width: 100%;
}
.ui-selectmenu-menu .ui-menu.customicons .ui-menu-item {
padding: 0.5em 0 0.5em 3em;
}
.ui-selectmenu-menu .ui-menu.customicons .ui-menu-item .ui-icon {
height: 24px;
width: 24px;
top: 0.1em;
}
.ui-icons.ES {
background: url('img/lang/ES.png') 0 0 no-repeat;
}
.ui-icons.EN {
background: url('img/lang/EN.png') 0 0 no-repeat;
}
.iu-icons.DE {
background: url('img/lang/DE.png') 0 0 no-repeat;
}
- </style>
- </head>
- <body>
- <select id="lang">
- <option value="es_ES" data-class="ES">ES - EspaƱol</option>
- <option value="en_EN" data-class="EN">EN - Ingles</option>
- <option value="de_DE" data-class="DE">DE - Aleman</option>
- </select>
- </body>
- </html>
This is my code and is not working...
In the console shows:
TypeError: base is not a constructor jquery-ui:409
Help please.