首页
学习
活动
专区
工具
TVP
发布

java大数据

专栏作者
627
文章
443559
阅读量
29
订阅数
css当中hover用法
6.hover 例 1.6 <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <style type="text/css"> #mymenu{ border: 1px solid black; /* refer to favo.dbk2008.com style.borderBottomWidth (Property) it corresponding CSS syntax: border-bottom-width: aWidth */ border-bottom-width: 4; width: 150px; background-color: #FF0000; } #mymenu a{ /*Elements having the display property set to "block" will be forced to start on a new line. qixy: this attribute can not be omitted.*/ display: block; /* the next statement is crucial, otherwise, there is no line inside the div. */ border-bottom: 1px solid black; } #mymenu a:hover{ font:bold 14pt Verdana; background-color: #ddddff; } </style> </head> <body> <div id="mymenu"> <a href="http://www.zhangsan.com/ ">张三</a> <a href="http://www.qixy.com">马克-to-win</a> <a href="http://www.lisi.com/">李四</a> </div> </body> </html>
马克java社区
2020-01-07
1K0
javascript当中createElement的用法
例 1.2(CreateP&InputIEFF.html) <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <style type="text/css"> .test { background:#0000FF; } </style> <SCRIPT LANGUAGE="JavaScript"> <!-- window.onload=function(){ var para = document.createElement("p"); /*the following statement para.innerHTML="qixy"; also can work.*/ // para.innerHTML="qixy"; var message = document.createTextNode("hello world"); para.appendChild(message); para.className="test"; /* we must use the following statement, use document.appendChild(para); is wrong.马克-to-win:因为document里同时有head元素和body元素*/ document.body.appendChild(para); /*the following statement totally can work.*/ var in1 = document.createElement("input"); in1.value="abc"; in1.id = "in1id" document.body.appendChild(in1); alert(""+document.getElementById("in1id").value); } //--> </SCRIPT> </HEAD> <BODY> </BODY> </HTML>
马克java社区
2020-01-07
5160
javascript当中如何操纵Node,(创建,附加,克隆,取代,去除,插入Node)
1.操纵Node,(创建,附加,克隆,取代,去除,插入Node) 例 1.1(cloneNode()IEFF.html) <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <SCRIPT LANGUAGE="JavaScript"> <!-- window.onload=function(){ var para = document.createElement("p"); var message = document.createTextNode("hello world"); para.appendChild(message); document.body.appendChild(para); /* Element object (Object/HTML) A common name for an object that represents an HTML tag or container. Inherits from: Node object BODY object (Object/HTML) An object that represents the body of a document. Inherits from: Element object Node.cloneNode() (Method) The node object is cloned but the new instance has no parent node defined. Property/method value type: Node object JavaScript syntax: - myNode.cloneNode(aSwitch) Argument list: aSwitch Indicates whether a deep or shallow clone is required if it is false, then it is shallow, then its child is not copyed. */ var newpara = para.cloneNode(true); document.body.appendChild(newpara); var debugzhanwei="zhanwei"; } //--> </SCRIPT> </HEAD> <BODY> </BODY> </HTML>
马克java社区
2020-01-06
5770
javascript当中link 的alternate stylesheet 用法
例 6.4:linkChangeCssFileIEFF.html 切换css文件:document.getElementsByTagName("link"); <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <TITLE> New Document </TITLE> <!-- 马克-to-win: here the idea is that for the whole page, sometimes, we use this css, sometimes, we use that css, with this method, we can switch. with this method, we can switch skin. "alternate stylesheet"是备用样式。 --> <link rel="alternate stylesheet" href="a.css" type="text/css" title="red" /> <link rel="stylesheet" href="b.css" type="text/css" title="green" /> <link rel="alternate stylesheet" href="c.css" type="text/css" title="blue" /> <script language="javascript"> function setActiveStyleSheet(t) { var links = document.getElementsByTagName("link"); links[0].disabled=false; links[1].disabled=true; links[2].disabled=true; alert(links[0].disabled+""+links[1].disabled+links[1].getAttribute("title")+links[2].getAttribute("href")); } </script> </HEAD> <body> 更多请见:https://blog.csdn.net/qq_43650923/article/details/102650892
马克java社区
2020-01-06
5760
javascript当中MapArea的用法
4.MapArea 例 4.1(MapAreaShapeIEFF.html) <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <body> <img src="markWeChat.jpg" border="0" usemap="#qixymap" /> <map name="qixymap" id="pmap"> <area shape="circle" coords="200,50,50" href ="us.html" target ="_blank" alt="us" /> <area shape="rect" coords="0,0,100,100" href ="rect.html" target ="_blank" alt="rect" /> </map> < p>马克-to-win:<b>注释:</b>img 元素中的 "usemap" 属性引用 map 元素中的 "id" 或 "name" 属性(根据浏览器),所以我们同时向 map 元素添加了 "id" 和 "name" 属性。</p> a.矩形:必须使用四个数字,前两个数字为左上角座标,后两个数字 为右下角座标 b.圆形:必须使用三个数字,前两个数字为圆心的座标,最后一个数 更多请见:https://blog.csdn.net/qq_43650923/article/details/102646475
马克java社区
2019-11-27
4020
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="<table class='my'><tr><td>" + txt + "</td></tr></table>";; } function closeTip() { var newDiv = document.getElementById('newDiv'); newDiv.style.display="none"; } </script> <style type="text/css"> <!-- .my { font-size: 13px; color: #000000; background-color: #99CC99; padding: 3px; } --> </style> </head> <body> <div id="newDiv" style="display: none; z-index: 1;"> </div> <img hidefocus="true" src="markWeChat.jpg" border="0" usemap="#qixyplanetmap" /> <map name="qixyplanetmap" id="planetmap"> <area shape="circle" coords="200,50,50" href ="us.html" target ="_blank" alt="us" onmousemove="showTip(event,'想加微信 <br /> 必须得扫一下<br /> 否则是<br />加不上的<br />知道了吗')" onmouseout="closeTip()" onmousedown="" /> <area shape="rect" coords="0,0,100,100" href ="rect.html" target ="_blank" alt="rect" onmousemove="showTip(event,'想加微信 <br /> 必须得扫一下<br /> 否则是<br />加不上的<br />知道了吗')" onmouseout="closeTip()" onmousedown="" /> </map> < p><b>马克-to-win:注释:</b>img 元素中的 "usemap" 属性引用 map 元素中的 "id" 或 "name" 属性(根据浏览器),所以我们同时向 map 元素添加了 "id" 和 "name" 属性。</p> a.矩形:必须使用四个数字,前两个数字为左上角座标,后两个数字为右下角座标
马克java社区
2019-11-27
5100
javascript当中Map Area Shape 的用法
例 4.3(MapAreaShapeMouseOverIEFF.html) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> <script language="javascript"> function show(obj) { var pos=obj.coords; pos=pos.split(","); alert("pos is "+pos+" pos[1] is "+pos[1]+" pos[2] is "+pos[2]); var menu=document.getElementById("info"); menu.style.left=parseInt(pos[2])+"px"; menu.style.top=parseInt(pos[1])+"px"; menu.style.display="inline"; } function hide() { var menu=document.getElementById("info"); menu.style.display="none"; } </script> </head>
马克java社区
2019-11-27
4350
javascript当中radio的用法
5.radio 例 5.1(RadioReferenceIEFF.html) <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <TITLE></TITLE> <SCRIPT LANGUAGE="JavaScript"> function clickH() { var form = document.forms[0]; if (form.school[0].checked) { form.school[1].checked = true; } } </SCRIPT> </HEAD> <BODY> <FORM METHOD=POST ACTION=""> 清华<INPUT TYPE="radio" NAME="school" value="th" checked><br> 北大<INPUT TYPE="radio" NAME="school" value="bd"><br> <INPUT TYPE="button" value="变" onClick="clickH()"/> </FORM> </BODY> </HTML> 更多请见:https://blog.csdn.net/qq_43650923/article/details/102515515
马克java社区
2019-11-27
1.8K0
javascript当中options的用法
6.options 选择列表 例 6.1(SelectOptionAddIEFF.html) <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <TITLE> </TITLE> <SCRIPT LANGUAGE="JavaScript"> <!-- /* a typical value is that document.getElementById("province").options[1]="河北", document.getElementById("city").options[1]= arr[0][1]= "石家庄" */ var arr = new Array( new Array("河北", "邯郸","石家庄"), new Array("山东", "济南", "枣庄", "威海"), new Array("河南", "开封", "郑州", "洛阳", "南洋") ); function setProvinces() { /* arr.length is the row number of arr, arr[i][0] the first column. in other words, 河北,山东,河南 */ for (var i = 0; i < arr.length; i++) { /*加到option最后,new Option(str1,str2)str1 是页面中看到的描述,而str2是这一项的值*/ document.getElementById("province").options[i + 1] = new Option(arr[i][0], arr[i][0]); } } function setCity(i) { alert(i+" "+document.getElementById("province").selectedIndex+document.getElementById("province").value+document.getElementById("province").options[document.getElementById("province").selectedIndex].text+document.getElementById("province").options[document.getElementById("province").selectedIndex].value); document.getElementById("city").options.length = 1;//reset city for (var j = 1; j < arr[i - 1].length; j++) { opt = new Option(arr[i - 1][j], arr[i - 1][j]); /*下面两种写法的结果是一样的*/ // document.getElementById("city").options[j] = new Option(arr[i - 1][j], arr[i - 1][j]); document.getElementById("city").add(opt,document.getElementById("city").options.length);//第二个参数指定元素放置所在的索引号 } // objSelect.add(objOption, objSelect.selectedIndex); } //--> </SCRIPT> </HEAD> <BODY onload="setProvinces()"> <!--Select.selectedIndex (Property) qi
马克java社区
2019-11-27
7240
javascript当中getElementsByName的用法
3.getElementsByName 例 3.1 getElementsByName()IEFF.html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> </HEAD> <BODY> <script type="text/javascript"> <!-- function choiceAll(t) { var arr = document.getElementsByName("ch"); for (var i=0;i<arr.length ;i++ ) { arr[i].checked = t } } //--> </script> <INPUT TYPE="checkbox" onclick="choiceAll(this.checked)" >全选<P> <INPUT TYPE="checkbox" NAME="ch"><BR> <INPUT TYPE="checkbox" NAME="ch"><BR> <INPUT TYPE="checkbox" NAME="ch"><BR> <INPUT TYPE="checkbox" NAME="ch"><BR> <INPUT TYPE="checkbox" NAME="ch"><BR> </BODY> </HTML>
马克java社区
2019-11-27
4750
javascript当中getElementsByTagName的用法
例 6.3:getElementsByTagName()IEFF.html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <SCRIPT LANGUAGE="JavaScript"> <!-- window.onload=function(){ var arr = document.getElementsByTagName("option"); alert("arr[i].value is "+arr[2].value); } //--> </SCRIPT> </HEAD> <BODY> <SELECT NAME="" id="province" style="width:140px;background-color:red"> <option>红</option> <option>兰</option> <option>紫</option> </SELECT> </BODY> </HTML>
马克java社区
2019-11-27
4340
javascript当中div在单行(float:left)用法
div在单行(float:left) 例 1.2.1 divInOneLineIEFF.html <div style="width:100px"> <div style="float:left; background-color:#CBCC00; width:33px">ab</div> <div style="float:left; background-color:#01000;width:34px">&nbsp;</div> <div style="float:left; background-color:#00CBFF;width:33px">bc</div> </div>
马克java社区
2019-11-26
8300
javascript当中float:left,clear:left,float:right和clear:right用法
2.float:left,clear:left,float:right和clear:right用法 例 1.2 <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <style type="text/css"> #first{ background-color:#EE1583; width:15%; float:left; } #second{ background-color:#90aaaa; width:15%; /*clear:right;*/ float:left; } #third{ background-color:#eeee00; width:15%; clear:left;/*马克-to-win:clear:left;效果就会换行了,文档:在左侧不允许浮动元素。*/ float:left; /*clear:right;*/ } #fourth{ background-color:#FF0000; width:20%; clear:left; /*clear:left;就会换行了*/ float:right; } #fifth{ background-color:#6A5ACD; width:20%; clear:right;/*上一个是clear:right,所以用clear:right;就会换行了*/ float:right; } </style> </head> <body> <span id="first" >11</span> <span id="second">22</span> <span id="third">33</span> <span id="fourth">44</span> <span id="fifth">55</span> </body> </html>
马克java社区
2019-11-26
1.1K0
javascript中html当中如何引用css文件
1.html当中如何引用css文件 马克-to-win:css:Cascading Style Sheets 例 1.1 <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title></title> <!-- LINK.rel (Property) The relationship between the current element and the remote document. --> <link href="outer.css" rel="stylesheet"> </head> <body> <table width="190" height="80" border="2" > <tr> <td >张三</td> </tr> <tr> <td>qixy</td> </tr> <tr> <td>李四</td> </tr> <tr> <td>王五</td> </tr> </table> </body> </html> outer.css: table { background-color: #0000ff; } td { /*the following statement make the border to show, because of the different color.*/ background-color: #FF0000; }
马克java社区
2019-11-26
2.3K0
javascript当中parseFloat用法
3)parseFloat 例 4.3.1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> </head> <BODY> <SCRIPT LANGUAGE="JavaScript"> <!-- /* 马克-to-win parseFloat() (Function/global) Parse a string to extract a floating-point value. Property/method value type: Number primitive JavaScript syntax: - parseFloat(aNumericString) Argument list: aNumericString A meaningful numeric value. The parseFloat() function returns a numeric value is returned, unless the string cannot be resolved to a meaningful value in which case NaN is returned instead. It produces a number value dictated by interpreting the contents of the string as if it were a decimal literal value. During conversion parseFloat() ignores leading whitespace characters so you don't have to remove them from the string before conversion takes place. Note that parseFloat() will only process the leading portion of the string. As soon as it encounters an invalid floating-point numeric character it will assume the scanning is complete. It will then silently ignore any remaining characters in the input argument. */ var x = parseFloat("727.079") var y = parseFloat("77.079xyz") var z= parseFloat("xyz77.079") document.write("x="+x+",y="+y+",z="+z) //--> </SCRIPT> </BODY> </HTML>
马克java社区
2019-11-26
6000
javascript当中parseInt用法
4)parseInt 例 4.4.1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> </head> <BODY> <SCRIPT LANGUAGE="JavaScript"> <!-- /* 马克-to-win: parseInt() (Function/global) Parse a string to extract an integer value. Property/method value type: Number primitive JavaScript syntax: - parseInt(aNumericString, aRadixValue) Argument list: aNumericString A string that comprises a meaningful numeric value. aRadixValue A numeric value indicating the radix for conversion The parseInt() function produces an integer value dictated by interpreting the string argument according to the specified radix. It can happily cope with hexadecimal values specified with the leading 0x or 0X notation. During conversion parseInt() will remove any leading whitespace characters. You don't need to do that to the string before parsing it. Note also that parseInt() may only interpret the leading portion of a string. As soon as it encounters an invalid integer numeric character it will assume the scanning is complete. It will then silently ignore any remaining characters in the input argument. Typical radix values are: 2 - Binary 8 - Octal 10 - Decimal 16 - Hexadecimal */ var x = parseInt("77") var y = parseInt("77xyz") document.write("x="+x+",y="+y) var x1 = window.parseInt("77",2) var y1 = parseInt("77",8) document.write("x1="+x1+",y1="+y1) //--> </SCRIPT> </BODY> </HTML>
马克java社区
2019-11-25
1.4K0
javascript当中isNaN用法
2)isNaN 例 4.2.1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> </head> <BODY> <SCRIPT LANGUAGE="JavaScript"> <!-- /*favo说isNaN是Global的方法, 而不是window的方法*/ var b1 = window.isNaN("25"); var b2 = isNaN("abc"); document.write("b1="+b1+",b2="+b2) //--> </SCRIPT> </BODY> </HTML>
马克java社区
2019-11-25
5320
javascript当中global对象用法
4.global对象 1)eval 例 4.1.1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> </head> <BODY> <SCRIPT LANGUAGE="JavaScript"> <!-- /*马克-to-win:var scriptCode = "c = a * b"; var a = 5; var b = 10; var c = 2; eval(scriptCode); 以上的话就相当于: eval("c = a * b");===c = a * b eval是global的方法, */ var result = window.eval("1+2/4") ;//根据上面所说,result=1+2/4; document.write(result) var s="today=new Date();document.write(today.toLocaleString())" eval(s) //--> </SCRIPT> </BODY> </HTML>
马克java社区
2019-11-25
5600
javascript当中eval用法
1)eval 例 4.1.1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> </head> <BODY> <SCRIPT LANGUAGE="JavaScript"> <!-- /*马克-to-win:var scriptCode = "c = a * b"; var a = 5; var b = 10; var c = 2; eval(scriptCode); 以上的话就相当于: eval("c = a * b");===c = a * b eval是global的方法, */ var result = window.eval("1+2/4") ;//根据上面所说,result=1+2/4; document.write(result) var s="today=new Date();document.write(today.toLocaleString())" eval(s) //--> </SCRIPT> </BODY> </HTML> 例 4.1.2 <HTML> <HEAD> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <TITLE>在eclipse中直接open with火狐即可</TITLE> </HEAD> <BODY> <SCRIPT LANGUAGE="JavaScript"> <!-- //例1 var s = "2+31-18"; /*When the eval() function is called, it expects a string to be passed to it as its single argument value. The contents of that string should be syntactically correct executable script source text.*/ document.write(eval(s)); var s1 = "2+31a-18"; /* note that we must comment out the following statement, otherwise, it reports error.*/ //document.write(eval(s1)); //例2 eval("d =new Date();document.write(d.toLocaleString())") //eval()函数的参数为字符串,功能是将该字符串执行出来。体会“执行”的意思! //--> </SCRIPT> </BODY> </HTML>
马克java社区
2019-11-25
1.2K0
javascript当中冒泡(event bubble)用法
9.冒泡(event bubble) 缺省情况下,当几个元素重合,事件从最上层元素开始往下层元素传播。 例 9.1(bubbleIEFF.html) <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <script type="text/javascript"> function docClick(event) { var event = event || window.event; alert("IE和FF一样:外面文档:"+event.type); } //document.captureEvents(Event.CLICK); document.onclick = docClick; </script> <div onClick="var event = event || window.event;alert('里面div:'+event.type);">ie和FF都冒泡从里往外</div> 缺省情况下,当几个元素嵌套重合,事件从最上层元素开始往下层元素传播。 例 9.2(bubble1currentTargetsrcElementIEFF.html) <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <script type="text/javascript"> function gotClick(event, who) { /* 1) 在ie中没有currentTarget,我们只能用下面的方法:来仿真火狐的效果。 2)马克-to-win:event.target是最上层的元素,event.currentTarget是最底层的元素 */ var event = event||window.event; var eTarget =event.srcElement||event.target; var eCurrentBottomTarget =event.srcElement||event.currentTarget; if (window.navigator.userAgent.indexOf("MSIE") >= 1) 更多请见:https://blog.csdn.net/qq_43650923/article/details/102211582
马克java社区
2019-10-30
6100
点击加载更多
社区活动
腾讯技术创作狂欢月
“码”上创作 21 天,分 10000 元奖品池!
Python精品学习库
代码在线跑,知识轻松学
博客搬家 | 分享价值百万资源包
自行/邀约他人一键搬运博客,速成社区影响力并领取好礼
技术创作特训营·精选知识专栏
往期视频·千货材料·成员作品 最新动态
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档