aboutsummaryrefslogtreecommitdiffstats
path: root/demos/selectmenu/custom_render.html
diff options
context:
space:
mode:
Diffstat (limited to 'demos/selectmenu/custom_render.html')
-rw-r--r--demos/selectmenu/custom_render.html89
1 files changed, 42 insertions, 47 deletions
diff --git a/demos/selectmenu/custom_render.html b/demos/selectmenu/custom_render.html
index a5f87700c..8e6b644fc 100644
--- a/demos/selectmenu/custom_render.html
+++ b/demos/selectmenu/custom_render.html
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
- <title>jQuery UI Selectmenu - Default functionality</title>
+ <title>jQuery UI Selectmenu - Custom Rendering</title>
<link rel="stylesheet" href="../../themes/base/all.css">
<script src="../../jquery.js"></script>
<script src="../../ui/core.js"></script>
@@ -19,14 +19,15 @@
var li = $( "<li>", { text: item.label } );
if ( item.disabled ) {
- li.addClass( "ui-state-disabled" ).text( item.label );
- } else {
- $( "<span>", {
- style: item.element.attr( "style" ),
- "class": "ui-icon " + item.element.attr( "class" )
- }).appendTo( li );
+ 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 );
}
});
@@ -34,17 +35,17 @@
$( "#filesA" )
.iconselectmenu()
.iconselectmenu( "menuWidget" )
- .addClass( "ui-menu-icons" );
+ .addClass( "ui-menu-icons" );
$( "#filesB" )
.iconselectmenu()
.iconselectmenu( "menuWidget" )
- .addClass( "ui-menu-icons customicons" );
+ .addClass( "ui-menu-icons customicons" );
$( "#people" )
.iconselectmenu()
.iconselectmenu( "menuWidget")
- .addClass( "ui-menu-icons avatar" );
+ .addClass( "ui-menu-icons avatar" );
});
</script>
<style>
@@ -61,10 +62,6 @@
width: 200px;
}
- .ui-selectmenu-menu .ui-menu .ui-menu-item a {
- padding-left: 2em;
- }
-
/* select with custom icons */
.ui-selectmenu-menu .ui-menu.customicons .ui-menu-item {
padding: 0.5em 0 0.5em 3em;
@@ -99,39 +96,37 @@
<div class="demo">
<form action="#">
-
- <h2>Selectmenu with framework icons</h2>
- <fieldset>
- <label for="filesA">Select a File:</label>
- <select name="filesA" id="filesA">
- <option value="jquery" class="ui-icon-script">jQuery.js</option>
- <option value="jquerylogo" class="ui-icon-image">jQuery Logo</option>
- <option value="jqueryui" class="ui-icon-script">ui.jQuery.js</option>
- <option value="jqueryuilogo" selected="selected" class="ui-icon-image">jQuery UI Logo</option>
- <option value="somefile">Some unknown file</option>
- </select>
- </fieldset>
-
- <h2>Selectmenu with custom icon images</h2>
- <fieldset>
- <label for="filesB">Select a podcast:</label>
- <select name="filesB" id="filesB">
- <option value="mypodcast" class="podcast">John Resig Podcast</option>
- <option value="myvideo" class="video">Scott Gonzales Video</option>
- <option value="myrss" class="rss">jQuery RSS XML</option>
- </select>
- </fieldset>
-
- <h2>Selectmenu with custom avatar 16x16 images as CSS background</h2>
- <fieldset>
- <label for="people">Select a Person:</label>
- <select name="people" id="people">
- <option value="1" class="avatar" style="background-image: url('http://www.gravatar.com/avatar/b3e04a46e85ad3e165d66f5d927eb609?d=monsterid&amp;r=g&amp;s=16');">John Resig</option>
- <option value="2" class="avatar" style="background-image: url('http://www.gravatar.com/avatar/e42b1e5c7cfd2be0933e696e292a4d5f?d=monsterid&amp;r=g&amp;s=16');">Tauren Mills</option>
- <option value="3" class="avatar" style="background-image: url('http://www.gravatar.com/avatar/bdeaec11dd663f26fa58ced0eb7facc8?d=monsterid&amp;r=g&amp;s=16');">Jane Doe</option>
- </select>
- </fieldset>
-
+ <h2>Selectmenu with framework icons</h2>
+ <fieldset>
+ <label for="filesA">Select a File:</label>
+ <select name="filesA" id="filesA">
+ <option value="jquery" data-class="ui-icon-script">jQuery.js</option>
+ <option value="jquerylogo" data-class="ui-icon-image">jQuery Logo</option>
+ <option value="jqueryui" data-class="ui-icon-script">ui.jQuery.js</option>
+ <option value="jqueryuilogo" selected="selected" data-class="ui-icon-image">jQuery UI Logo</option>
+ <option value="somefile" disabled="disabled" data-class="ui-icon-help">Some unknown file</option>
+ </select>
+ </fieldset>
+
+ <h2>Selectmenu with custom icon images</h2>
+ <fieldset>
+ <label for="filesB">Select a podcast:</label>
+ <select name="filesB" id="filesB">
+ <option value="mypodcast" data-class="podcast">John Resig Podcast</option>
+ <option value="myvideo" data-class="video">Scott González Video</option>
+ <option value="myrss" data-class="rss">jQuery RSS XML</option>
+ </select>
+ </fieldset>
+
+ <h2>Selectmenu with custom avatar 16x16 images as CSS background</h2>
+ <fieldset>
+ <label for="people">Select a Person:</label>
+ <select name="people" id="people">
+ <option value="1" data-class="avatar" data-style="background-image: url('http://www.gravatar.com/avatar/b3e04a46e85ad3e165d66f5d927eb609?d=monsterid&amp;r=g&amp;s=16');">John Resig</option>
+ <option value="2" data-class="avatar" data-style="background-image: url('http://www.gravatar.com/avatar/e42b1e5c7cfd2be0933e696e292a4d5f?d=monsterid&amp;r=g&amp;s=16');">Tauren Mills</option>
+ <option value="3" data-class="avatar" data-style="background-image: url('http://www.gravatar.com/avatar/bdeaec11dd663f26fa58ced0eb7facc8?d=monsterid&amp;r=g&amp;s=16');">Jane Doe</option>
+ </select>
+ </fieldset>
</form>
</div>