官术网_书友最值得收藏!

Changing the colors

HTML5 provides browsers with a full-featured color picker (typically, browsers use the native OS's color chooser). This will be used to allow the user to set the background color of the editor application itself:

Changing the colors

The color picker is added to the index.html page with the following HTML:

<input id="pckBackColor" type="color">

The implementation is straightforward as the color picker control provides:

InputElement cp = qs("#pckBackColor");
cp.onChange.listen((e) => document.body.style.backgroundColor = cp.value);

Because the event and property (onChange and value) are common to the input controls, the basic InputElement class can be used.

主站蜘蛛池模板: 云林县| 临猗县| 西贡区| 新密市| 岳普湖县| 邵武市| 夹江县| 甘泉县| 澎湖县| 特克斯县| 宁安市| 龙南县| 绥芬河市| 扎兰屯市| 静安区| 绍兴市| 宁安市| 平度市| 建昌县| 垣曲县| 岚皋县| 芦山县| 松溪县| 闻喜县| 皮山县| 桃源县| 饶河县| 大方县| 永嘉县| 和田市| 新安县| 蛟河市| 库伦旗| 井研县| 浦东新区| 宣威市| 鄂托克旗| 南宁市| 昭苏县| 牙克石市| 桐柏县|