This repository has been archived by the owner on Jan 23, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.html
227 lines (195 loc) · 12.3 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=640" />
<link rel="stylesheet" href="stylesheets/core.css" media="screen"/>
<link rel="stylesheet" href="stylesheets/mobile.css" media="handheld, only screen and (max-device-width:640px)"/>
<link rel="stylesheet" href="stylesheets/pygment_trac.css"/>
<script type="text/javascript" src="javascripts/modernizr.js"></script>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.22/jquery-ui.min.js"></script>
<script type="text/javascript" src="javascripts/headsmart.min.js"></script>
<script type="text/javascript" src="javascripts/ie_expand_select_width.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#main_content').headsmart();
$('select').ieExpandSelectWidth();
$('#s7').bind('blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error', function(e) {
var box = $('textarea');
box.val(new Date().getTime() + ' ' + e.type + '\n' + box.val());
});
});
</script>
<title>IE8 expand select width by PowerKiKi</title>
<style>
textarea {width: 100%; height: 15em;}
select {width: 15em;}
p.custom_style { background: grey; }
p.custom_style select { font-size: 1.3em; }
</style>
</head>
<body>
<a id="forkme_banner" href="https://github.com/PowerKiKi/ie_expand_select_width">View on GitHub</a>
<div class="shell">
<header>
<span class="ribbon-outer">
<span class="ribbon-inner">
<h1>IE8 expand select width</h1>
<h2></h2>
</span>
<span class="left-tail"></span>
<span class="right-tail"></span>
</span>
</header>
<section id="downloads">
<span class="inner">
<a href="https://github.com/PowerKiKi/ie_expand_select_width/zipball/master" class="zip"><em>download</em> .ZIP</a><a href="https://github.com/PowerKiKi/ie_expand_select_width/tarball/master" class="tgz"><em>download</em> .TGZ</a>
</span>
</section>
<span class="banner-fix"></span>
<section id="main_content">
<h1>Introduction</h1>
<p>This page demonstrate the use of jQuery plugin ie_expand_select_width to fix select box width issue on IE8. Contrary to several other solutions, this script keep the page layout intact and is keyboard friendly.</p>
<p>See <a href="http://css-tricks.com/select-cuts-off-options-in-ie-fix/">the article on css-tricks.com</a> for a full explanation of the problem.</p>
<p>For demo purpose the script is active for all browsers on this page, but it <strong>only works properly with Internet Explorer 8</strong>.</p>
<h2>Usage</h2>
Include the script only for IE8:
<pre><script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.22/jquery-ui.min.js"></script>
<!--[if IE 8]>
<script type="text/javascript" src="ie_expand_select_width.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('select').ieExpandSelectWidth();
});
</script>
<![endif]--></pre>
<h1>Demo</h1>
<h3>Simple</h3>
<select id="s0">
<option>s0: no label, short</option>
<option>s0: no label, long: Lorem ipsum dolor sit amet, consectetur adipiscing elit.</option>
<option label="s0: my short label" >this text will not appear</option>
<option label="s0: my long label: Lorem ipsum dolor sit amet, consectetur adipiscing elit.">this text will not appear either</option>
</select>
<h3>Within text</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.
<select id="s1">
<option>s1: no label, short</option>
<option>s1: no label, long: Lorem ipsum dolor sit amet, consectetur adipiscing elit.</option>
<option label="s1: my short label" >this text will not appear</option>
<option label="s1: my long label: Lorem ipsum dolor sit amet, consectetur adipiscing elit.">this text will not appear either</option>
</select>
Sed diam enim, pharetra ac tempus eu, ullamcorper a nibh. Etiam dui urna,
adipiscing fermentum semper sit amet, molestie nec tortor.
<select id="s2">
<option>s2: no label, short</option>
<option>s2: no label, long: Lorem ipsum dolor sit amet, consectetur adipiscing elit.</option>
<option label="s2: my short label" >this text will not appear</option>
<option label="s2: my long label: Lorem ipsum dolor sit amet, consectetur adipiscing elit.">this text will not appear either</option>
</select>
<select id="s3">
<option>s3: no label, short</option>
<option>s3: no label, long: Lorem ipsum dolor sit amet, consectetur adipiscing elit.</option>
<option label="s3: my short label" >this text will not appear</option>
<option label="s3: my long label: Lorem ipsum dolor sit amet, consectetur adipiscing elit.">this text will not appear either</option>
</select>
accumsan ullamcorper. Nam sem lorem, pellentesque nec molestie eu, luctus quis sem.
Maecenas ac dolor eu nunc posuere semper.
</p>
<h3>Within table</h3>
<table>
<tr>
<td>
<select id="s4">
<option>s4: no label, short</option>
<option>s4: no label, long: Lorem ipsum dolor sit amet, consectetur adipiscing elit.</option>
<option label="s4: my short label" >this text will not appear</option>
<option label="s4: my long label: Lorem ipsum dolor sit amet, consectetur adipiscing elit.">this text will not appear either</option>
</select>
</td>
<td>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</td>
</tr>
<tr>
<td>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</td>
<td>
<select id="s5">
<option>s5: no label, short</option>
<option>s5: no label, long: Lorem ipsum dolor sit amet, consectetur adipiscing elit.</option>
<option label="s5: my short label" >this text will not appear</option>
<option label="s5: my long label: Lorem ipsum dolor sit amet, consectetur adipiscing elit.">this text will not appear either</option>
</select>
</td>
</tr>
</table>
<h3>Do not shorten</h3>
<p>
<select id="s6">
<option>s6: only short 1</option>
<option>s6: only short 2</option>
<option>s6: only short 3</option>
</select>
</p>
<h3>Do not break other events</h3>
<textarea></textarea>
<select id="s7">
<option>s7: no label, short</option>
<option>s7: no label, long: Lorem ipsum dolor sit amet, consectetur adipiscing elit.</option>
<option label="s7: my short label" >this text will not appear</option>
<option label="s7: my long label: Lorem ipsum dolor sit amet, consectetur adipiscing elit.">this text will not appear either</option>
</select>
<h3>Custom style</h3>
<p class="custom_style">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sem lorem, pellentesque nec molestie eu, luctus quis sem.
Maecenas ac dolor eu nunc posuere semper.
<select id="s8" style="padding: 1em; margin: 2em; border: 1em red solid; ">
<option>s8: no label, short</option>
<option>s8: no label, long: Lorem ipsum dolor sit amet, consectetur adipiscing elit.</option>
<option label="s8: my short label" >this text will not appear</option>
<option label="s8: my long label: Lorem ipsum dolor sit amet, consectetur adipiscing elit.">this text will not appear either</option>
</select>
Sed diam enim, pharetra ac tempus eu, ullamcorper a nibh. Etiam dui urna,
adipiscing fermentum semper sit amet, molestie nec tortor.
</p>
<h3>100% width does not expand too much</h3>
<div style="width: 50%; background: grey; padding: 1em; ">
<select id="s9" style="width: 100%; ">
<option>s9: no label, short</option>
<option>s9: no label, long: Lorem ipsum dolor sit amet, consectetur adipiscing elit.</option>
<option label="s9: my short label" >this text will not appear</option>
<option label="s9: my long label: Lorem ipsum dolor sit amet, consectetur adipiscing elit.">this text will not appear either</option>
</select>
</div>
<h3>Do nothing for multiple choices</h3>
<select id="s10" multiple="multiple">
<option>s10: no label, short</option>
<option label="s10: my short label" >this text will not appear</option>
</select>
<select id="s11" size="3">
<option>s11: no label, short</option>
<option label="s11: my short label" >this text will not appear</option>
</select>
<h3>Also expand max-width</h3>
<select id="s12" style="max-width: 5em; ">
<option>s12: no label, short</option>
<option>s12: no label, long: Lorem ipsum dolor sit amet, consectetur adipiscing elit.</option>
<option label="s12: my short label" >this text will not appear</option>
<option label="s12: my long label: Lorem ipsum dolor sit amet, consectetur adipiscing elit.">this text will not appear either</option>
</select>
</section>
<footer>
<span class="ribbon-outer">
<span class="ribbon-inner">
<p>this project by <a href="https://github.com/PowerKiKi">PowerKiKi</a> can be found on <a href="https://github.com/PowerKiKi/ie_expand_select_width">GitHub</a></p>
</span>
<span class="left-tail"></span>
<span class="right-tail"></span>
</span>
<p>Generated with <a href="http://pages.github.com">GitHub Pages</a> using Merlot</p>
<span class="octocat"></span>
</footer>
</div>
</body>
</html>