| как в <select> добавить <option>? | |
| От: | . | ||
| Дата: | 29.03.10 18:13 |
не работает.
добавляет, но размер контрола не пересчитывается по содержимому опции. Posted via RSDN NNTP Server 2.1 beta но это не зря, хотя, может быть, невзначай гÅрмония мира не знает границ — сейчас мы будем пить чай |
| Re: как в <select> добавить <option>? | |
| От: | c-smile эксперт | ||
| Дата: | 29.03.10 22:21 | ||
| Оценка: | 1 (1) | ||
| Здравствуйте, ., Вы писали: .>
.>не работает. .>
.>добавляет, но размер контрола не пересчитывается по содержимому опции. Not that pretty but should work: `<html> <head> <style> select#myselect { width: calc( child(2).box-border-width() + /* <button> width */ child(3).max-intrinsic-width() + /* <popup> max width */ 5px /* width of paddings/margins on <caption> */ ); } </style> <script type="text/tiscript"> function self#test.onClick() { self.select("#myselect popup").append("<option>new option</option>"); self.select("#myselect").update(true); } </script> </head> <body> <button #test>Test</button> <select #myselect> </select> </body> </html>` http://terrainformatica.com/forums/topic.php?id=1128&page&replies=4#post-5485 |