文档详情

《网页设计与制作(HTML+CSS+JavaScript)》课件_CORE-12.ppt

发布:2025-03-16约2.86千字共15页下载文档
文本预览下载声明

第十二章表单、其它对象的应用目标理解表单、其它对象的应用范围。掌握表单、其它对象的应用技术。概述、专业术语表单最主要的应用是保存、处理、传送数据,响应Web控件发生的事件。其它对象的应用。这些对象包括Navigator、History以及其它一些方法。术语词汇表定义在此章节中使用的术语简易计算器计算器的制作简易计算器计算器的制作——设计界面formname=sc inputtype=textname=boxsize=15br inputtype=buttonvalue=7 inputtype=buttonvalue=8 inputtype=buttonvalue=9br inputtype=buttonvalue=4 inputtype=buttonvalue=5 inputtype=buttonvalue=6br inputtype=buttonvalue=1 inputtype=buttonvalue=2 inputtype=buttonvalue=3br inputtype=buttonvalue=0 inputtype=buttonvalue=+ inputtype=buttonvalue=-br inputtype=buttonvalue=* inputtype=buttonvalue=/ inputtype=buttonvalue==/form简易计算器计算器的制作——编写js处理函数scriptlanguage=JavaScriptvarst=0;//用于记录计算结果varopertr;//用于保存运算符//根据传入的参数的不同进行不同的处理functioncount(t){ //代码 }//运算,将结果保存在变量st中functionoper(){ //代码}/script简易计算器计算器的制作——给界面按钮添加事件处理formname=sc inputtype=textname=boxsize=15br inputtype=buttonvalue=7onClick=count(7) inputtype=buttonvalue=8onClick=count(8) inputtype=buttonvalue=9onClick=count(9)br inputtype=buttonvalue=4onClick=count(4) inputtype=buttonvalue=5onClick=count(5) inputtype=buttonvalue=6onClick=count(6)br inputtype=buttonvalue=1onClick=count(1) inputtype=buttonvalue=2onClick=count(2) inputtype=buttonvalue=3onClick=count(3)br inputtype=buttonvalue=0onClick=count(0) inputtype=buttonvalue=+onClick=count(‘+’) inputtype=buttonvalue=-onClick=count(‘-’)br inputtype=buttonvalue=*onClick=count(‘*’) inputtype=buttonvalue=/onClick=count(‘/’) inputtype=buttonvalue==onClick=count(‘=‘)/form简易计算器计算器的制作——运行导航栏水平导航下拉菜单栏的制作导航栏制作主要分为三大部分:HTML部分、CSS部分和JavaScript部分。下面我们首先看一下它的html部分。示例代码12-2效果如下导航栏接下来我们编写相关的JavaScript函数示例代码见课本12-3效果如下导航栏functionsetMouseActions(nod

显示全部
相似文档