首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

javascript当中Map Area Shape 和onmousemove的用法

例 4.2(MapAreaShapeMouseMoveIEFF.html) <html> <head> <title> img hidefocus="true"必须加,否则ie8中点击map后,会粗线一个contour, 轮廓线</title> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <script type="text/javascript"> function showTip(event,txt) { var newDiv = document.getElementById('newDiv'); newDiv.style.display="block"; //clientX是鼠标指针位置相对于窗口客户区域的 x 坐标 newDiv.style.left=event.clientX+10; //必须加上10,如果不加10的话,老会闪烁 newDiv.style.top=event.clientY+5; newDiv.style.position="absolute"; //必须指定这个属性,否则newDiv层无法跟着鼠标动 newDiv.innerHTML="

" + txt + "
";; } function closeTip() { var newDiv = document.getElementById('newDiv'); newDiv.style.display="none"; } </script> <style type="text/css"> </style> </head> <body>
<map name="qixyplanetmap" id="planetmap"> us rect </map> < p>马克-to-win:注释:img 元素中的 "usemap" 属性引用 map 元素中的 "id" 或 "name" 属性(根据浏览器),所以我们同时向 map 元素添加了 "id" 和 "name" 属性。

a.矩形:必须使用四个数字,前两个数字为左上角座标,后两个数字为右下角座标

01
您找到你想要的搜索结果了吗?
是的
没有找到

javascript当中静态方法和prototype用法

6)静态方法和prototype(难) 例 3.6.1 <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> </head> <script> /*note that 马克-to-win: static variable's value has nothing to do with instance's variable's value.instance 名称 can not 直接access static member like in java. This is different from Java,比如下面例子中,Student.number=2,但是d1.number就为undefined.This is different from Java,但在实例方法中(比如d1.info)可以访问Student.number。这是和java中一样的。或者说function外或任何地方都可以访问Student.number。反过来,d1.age也可以在静态方法中访问,就像在function外一样,任何地方都能访问d1.age。String.prototype.abcd,这是给所有的实例加属性而不是静态属性。*/ function Student(number, agev) { this.age = agev; /*static variable's value can not be accessed by instance */ Student.number = number; /*lb is local variable, but not a member variable because it is not modified by this. from outside it can not be accessed. refer to noblockScope.html */ var lb = 0; } var d1 = new Student(1, 3); document.writeln("this的age属性为means window.age" + this.age + "
"); document.writeln("d1的age属性为" + d1.age + "
"); document.writeln("d1的number属性为" + d1.number + "
"); document.writeln("通过Student访问静态number属性为" + Student.number + "
"); document.writeln("d1的lb属性为" + d1.lb + "


"); d1.qixy = "abc";/*以随意为实例加属性或方法*/ document.writeln("可以随意为实例加属性或方法see following,d1的qixy属性为" + d1.qixy + "

"); document.writeln("是否有静态变量qixy" + Student.qixy + "

"); d1.info = function()/*此方法仅为d1对象所用*/ { document.writeln("对象的qixy属性:" + this.qixy); document.writeln("对象的age属性:" + this.age); /*下列话是合法的, 因为不是this.number, 而是Student.number*/ document.writeln("static method is " + Student.number); }; Student.prototype.infop = function()/*此方法可以为所有Student对象所用*/ { document.writeln("对象的qixy属性p:" + this.qixy); document.writeln("对象的age属性p:" + this.age);

02

6.超链接-HTML基础

一、何为超链接 1.a标签 在HTML中,使用a标签来实现超链接。 (1)语法格式 文本或图片 ① 说明 href表示想要跳转到的那个页面的路径,可以是相对路径,也可以是绝对路径。 我们可以将文本设置为超链接,即文本超链接;也可以将图片设置为超链接,即图片超链接。 (2)示例 ① 例1-文本超链接 <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <

03

HTML之元素、属性、标题、段落【笔记小结】

1 元素1.1 语法示例:开始标签元素内容 结束标签

段落

链接
换行语法:# 以开始标签起始,以结束标签终止;# 元素内容是开始标签与结束标签之间的内容;# 空元素在开始标签中进行关闭(以开始标签的结束而结束);# 多数元素可拥有属性。1.2 元素嵌套比如之前写的:<!DOCTYPE html><html><head> <meta charset="utf-8"> <title>开始学习html,这是我的第一个页面,哈哈哈!</title></head><

06
领券