corrade-http-templates – Blame information for rev 57
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
57 | office | 1 | <!doctype html> |
2 | <html lang="en"> |
||
3 | <head> |
||
4 | <meta charset="utf-8"> |
||
5 | <meta name="viewport" content="width=device-width, initial-scale=1"> |
||
6 | <title>jQuery UI Selectmenu - Custom Rendering</title> |
||
7 | <link rel="stylesheet" href="../../themes/base/all.css"> |
||
8 | <link rel="stylesheet" href="../demos.css"> |
||
9 | <script src="../../external/requirejs/require.js"></script> |
||
10 | <script src="../bootstrap.js"> |
||
11 | $.widget( "custom.iconselectmenu", $.ui.selectmenu, { |
||
12 | _renderItem: function( ul, item ) { |
||
13 | var li = $( "<li>" ), |
||
14 | wrapper = $( "<div>", { text: item.label } ); |
||
15 | |||
16 | if ( item.disabled ) { |
||
17 | li.addClass( "ui-state-disabled" ); |
||
18 | } |
||
19 | |||
20 | $( "<span>", { |
||
21 | style: item.element.attr( "data-style" ), |
||
22 | "class": "ui-icon " + item.element.attr( "data-class" ) |
||
23 | }) |
||
24 | .appendTo( wrapper ); |
||
25 | |||
26 | return li.append( wrapper ).appendTo( ul ); |
||
27 | } |
||
28 | }); |
||
29 | |||
30 | $( "#filesA" ) |
||
31 | .iconselectmenu() |
||
32 | .iconselectmenu( "menuWidget" ) |
||
33 | .addClass( "ui-menu-icons" ); |
||
34 | |||
35 | $( "#filesB" ) |
||
36 | .iconselectmenu() |
||
37 | .iconselectmenu( "menuWidget" ) |
||
38 | .addClass( "ui-menu-icons customicons" ); |
||
39 | |||
40 | $( "#people" ) |
||
41 | .iconselectmenu() |
||
42 | .iconselectmenu( "menuWidget") |
||
43 | .addClass( "ui-menu-icons avatar" ); |
||
44 | </script> |
||
45 | <style> |
||
46 | h2 { |
||
47 | margin: 30px 0 0 0; |
||
48 | } |
||
49 | fieldset { |
||
50 | border: 0; |
||
51 | } |
||
52 | label { |
||
53 | display: block; |
||
54 | } |
||
55 | |||
56 | /* select with custom icons */ |
||
57 | .ui-selectmenu-menu .ui-menu.customicons .ui-menu-item-wrapper { |
||
58 | padding: 0.5em 0 0.5em 3em; |
||
59 | } |
||
60 | .ui-selectmenu-menu .ui-menu.customicons .ui-menu-item .ui-icon { |
||
61 | height: 24px; |
||
62 | width: 24px; |
||
63 | top: 0.1em; |
||
64 | } |
||
65 | .ui-icon.video { |
||
66 | background: url("images/24-video-square.png") 0 0 no-repeat; |
||
67 | } |
||
68 | .ui-icon.podcast { |
||
69 | background: url("images/24-podcast-square.png") 0 0 no-repeat; |
||
70 | } |
||
71 | .ui-icon.rss { |
||
72 | background: url("images/24-rss-square.png") 0 0 no-repeat; |
||
73 | } |
||
74 | |||
75 | /* select with CSS avatar icons */ |
||
76 | option.avatar { |
||
77 | background-repeat: no-repeat !important; |
||
78 | padding-left: 20px; |
||
79 | } |
||
80 | .avatar .ui-icon { |
||
81 | background-position: left top; |
||
82 | } |
||
83 | </style> |
||
84 | </head> |
||
85 | <body> |
||
86 | |||
87 | <div class="demo"> |
||
88 | |||
89 | <form action="#"> |
||
90 | <h2>Selectmenu with framework icons</h2> |
||
91 | <fieldset> |
||
92 | <label for="filesA">Select a File:</label> |
||
93 | <select name="filesA" id="filesA"> |
||
94 | <option value="jquery" data-class="ui-icon-script">jQuery.js</option> |
||
95 | <option value="jquerylogo" data-class="ui-icon-image">jQuery Logo</option> |
||
96 | <option value="jqueryui" data-class="ui-icon-script">ui.jQuery.js</option> |
||
97 | <option value="jqueryuilogo" selected="selected" data-class="ui-icon-image">jQuery UI Logo</option> |
||
98 | <option value="somefile" disabled="disabled" data-class="ui-icon-help">Some unknown file</option> |
||
99 | </select> |
||
100 | </fieldset> |
||
101 | |||
102 | <h2>Selectmenu with custom icon images</h2> |
||
103 | <fieldset> |
||
104 | <label for="filesB">Select a podcast:</label> |
||
105 | <select name="filesB" id="filesB"> |
||
106 | <option value="mypodcast" data-class="podcast">John Resig Podcast</option> |
||
107 | <option value="myvideo" data-class="video">Scott González Video</option> |
||
108 | <option value="myrss" data-class="rss">jQuery RSS XML</option> |
||
109 | </select> |
||
110 | </fieldset> |
||
111 | |||
112 | <h2>Selectmenu with custom avatar 16x16 images as CSS background</h2> |
||
113 | <fieldset> |
||
114 | <label for="people">Select a Person:</label> |
||
115 | <select name="people" id="people"> |
||
116 | <option value="1" data-class="avatar" data-style="background-image: url('http://www.gravatar.com/avatar/b3e04a46e85ad3e165d66f5d927eb609?d=monsterid&r=g&s=16');">John Resig</option> |
||
117 | <option value="2" data-class="avatar" data-style="background-image: url('http://www.gravatar.com/avatar/e42b1e5c7cfd2be0933e696e292a4d5f?d=monsterid&r=g&s=16');">Tauren Mills</option> |
||
118 | <option value="3" data-class="avatar" data-style="background-image: url('http://www.gravatar.com/avatar/bdeaec11dd663f26fa58ced0eb7facc8?d=monsterid&r=g&s=16');">Jane Doe</option> |
||
119 | </select> |
||
120 | </fieldset> |
||
121 | </form> |
||
122 | |||
123 | </div> |
||
124 | |||
125 | <div class="demo-description"> |
||
126 | <p>The whole rendering process is extendable to make custom styling as easy as possible.</p> |
||
127 | </div> |
||
128 | </body> |
||
129 | </html> |