Make the prototype version more like the jQuery version (doesn't sniff for a class any longer)
This commit is contained in:
parent
800e3d5502
commit
a7a8ad54e2
4 changed files with 17 additions and 22 deletions
17
example.html
17
example.html
|
@ -1263,11 +1263,26 @@
|
|||
<p>Using Chosen is easy as can be.</p>
|
||||
<ol>
|
||||
<li>Download the plugin and copy the chosen files to your app.</li>
|
||||
<li>Add the class <em>chzn-select</em> to any select box.</li>
|
||||
<li>Activate the plugin by creating a new instance of Chosen: New Chosen(<em>some_form_field</em>);</li>
|
||||
<li><a href="http://youtu.be/pS-RsIzb78U?t=57s">Disco</a>.</li>
|
||||
</ol>
|
||||
|
||||
</div>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/prototype/1.7.0.0/prototype.js" type="text/javascript"></script>
|
||||
<script src="chosen/chosen.proto.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
document.observe('dom:loaded', function(evt) {
|
||||
var select, selects, _i, _len, _results;
|
||||
if (Prototype.Browser.IE && (Prototype.BrowserFeatures['Version'] === 6 || Prototype.BrowserFeatures['Version'] === 7)) {
|
||||
return;
|
||||
}
|
||||
selects = $$(".chzn-select");
|
||||
_results = [];
|
||||
for (_i = 0, _len = selects.length; _i < _len; _i++) {
|
||||
select = selects[_i];
|
||||
_results.push(new Chosen(select));
|
||||
}
|
||||
return _results;
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue