读书人

(四)事件处理(9)让其他按钮可

发布时间: 2013-10-27 15:21:50 作者: rapoo

(4)事件处理——(9)让其他按钮可用(Enabling the other buttons)

We now have a Large Printbutton that works as advertised, but we need to apply similar handling to the other two buttons (Defaultand Narrow Column) to make them perform their tasks. This is straightforward; we use .bind()to add a clickhandler to each of them, removing and adding classes as necessary. The new code reads as shown in the following code snippet:


Clicking on Defaultremoves both class names from the <body>tag, returning the page to its initial rendering.

现在点击窄行间距按钮后,对应的css将会被应用,然后文本将会变得不同:

(四)事件处理——(9)让其他按钮可用(Enabling the other buttons)

点击默认按钮,将移去body标签上的两个类,染回网页初始渲染的样子。

读书人网 >其他相关

热点推荐