首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 其他相关 >

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

2013-10-27 
(4)事件处理——(9)让其他按钮可用(Enabling the other buttons)We now have a Large Printbutton that work

(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标签上的两个类,染回网页初始渲染的样子。

热点排行