三个矩形设置为响应键盘上的数字键1、2和3。
The three rectangles are set to respond to number keys 1, 2, and 3 on your keyboard.
所有矩形都设置为响应onclick、onmouseover和onmouseout事件,它们为此调用的是同一个脚本函数。
All the rectangles are set to respond to onclick, onmouseover, and onmouseout events, and all call the same scripted functions to do this.
设置按钮的宽度只是稍微复杂一点:复制矩形的宽度并在元素中增加了一个单位,为矩形的边框留下位置。
Fixing the button's width is only slightly more complicated: the width is copied as is on the rectangle, but incremented by one unit on the element to leave room for the rectangle's stroke.
应用推荐