电脑十万个为什么网页专区内容摘要:

) { if (i == 0) { (layer name=\dot+ i +\ left=\1\ )。 (top=\1\ visibility=\show\font color=\blue\)。 (,/font/layer)。 } else { (layer name=\dot+ i +\ left=\1\ )。 (top=\1\ visibility=\show\font color=\blue\)。 (,/font/layer)。 } } else if (ie4up) { if (i == 0) { (div id=\dot+ i +\ style=\POSITION: )。 (absolute。 ZINDEX: + i +。 VISIBILITY: )。 (visible。 TOP: 15px。 LEFT: 15px。 \font color=\blue\)。 (,/font/div)。 } else { (div id=\dot+ i +\ style=\POSITION: )。 (absolute。 ZINDEX: + i +。 VISIBILITY: )。 (visible。 TOP: 15px。 LEFT: 15px。 \font color=\blue\)。 (’/font/div)。 // 设定雨点的字符 } } } function initRain() { a = 6。 r[i] = 1。 sn = (a)。 cs = (a)。 cx[i] = () * doc_width + 1。 cy[i] = () * doc_height + 1。 x[i] = r[i] * sn + cx[i]。 y[i] = cy[i]。 } function makeRain() { r[i] = 1。 cx[i] = () * doc_width + 1。 cy[i] = 1。 x[i] = r[i] * sn + cx[i]。 y[i] = r[i] * cs + cy[i]。 } function updateRain() { r[i] += s。 x[i] = r[i] * sn + cx[i]。 y[i] = r[i] * cs + cy[i]。 } function raindropNS() { for (i = 0。 i no。 ++ i) { updateRain()。 if ((x[i] = 1) || (x[i] = (doc_width 20)) || (y[i] = (doc_height 20))) { makeRain()。 doc_width =。 doc_height =。 } [dot+i].top = y[i]。 [dot+i].left = x[i]。 } setTimeout(raindropNS(), speed)。 } function raindropIE() { for (i = 0。 i no。 ++ i) { updateRain()。 if ((x[i] = 1) || (x[i] = (doc_width 20)) || (y[i] = (doc_height 20))) { makeRain()。 doc_width =。 doc_height =。 } [dot+i]. = y[i]。 [dot+i]. = x[i]。 } setTimeout(raindropIE(), speed)。 } if (ns4up) {raindropNS()。 } else if (ie4up) {raindropIE()。 } // End /Script 36,Q:“ 地震 ”JavaScript 脚本: A:将以下脚本放在〈 Body〉〈 /Body〉中间即可: script language= ! function shake(n) { if () {for (i = 10。 i 0。 i) {for (j = n。 j 0。 j) {(0,i)。 (i,0)。 (0,i)。 (i,0)。 } } } } // /script forminput onclick=shake(2) type=button value=地震啦。 /form 37,Q:一个用 JavaScript 实现的简陋的计算器: A:全部代码如下: html head script language=JavaScript ! function pute(obj) { = eval()} var one = 39。 139。 var two = 39。 239。 var three = 39。 339。 var four = 39。 439。 var five = 39。 539。 var six = 39。 639。 var seven = 39。 739。 var eight = 39。 839。 var nine = 39。 939。 var zero = 39。 039。 var plus = 39。 +39。 var minus = 39。 39。 var multiply = 39。 *39。 var divide = 39。 /39。 var decimal = 39。 .39。 function enter(obj, string) { += string} function clear(obj, string) { = 39。 39。 } // /script /head body form name=calc table border=1 tr align=right td colspan=4input name=expr action=pute()/td /tr tr align=center tdinput type=button value= 7 onClick=enter(, seven)/td tdinput type=button value= 8 onClick=enter(, eight)/td tdinput type=button value= 9 onClick=enter(, nine)/td tdinput type=button value= / onClick=enter(, divide)/td /tr tr align=center tdinput type=button value= 4 onClick=enter(, four)/td tdinput type=button value= 5 onClick=enter(, five)/td tdinput type=button value= 6 onClick=enter(, six)/td tdinput type=button value= * onClick=enter(, multiply)/td /tr tr align=center tdinput type=button value= 1 onClick=enter(, one) tdinput type=button value= 2 onClick=enter(, two) tdinput type=button value= 3 onClick=enter(, three) tdinput type=button value= onClick=enter(, minus)/td /tr tr align=center td colspan=2input type=button value= 0 onClick=enter(, zero) tdinput type=button value= . onClick=enter(, decimal)/td tdinput type=button value= + onClick=enter(, plus)/td /tr tr align=center td colspan=2input type=button value= = onClick=pute()/td td colspan=2input type=button value= AC size= 3 onClick= = 39。 39。 /td /tr /table /form /body /html 38,Q:在网页上实现 “ 预览图 ” : A:网页制做时,大的图片会消耗较长的下载时间,为了不使浏览者失去耐心,可以采用 “ 预览图 ”(low source) 的办法,即先下载一个 “low source” ,然后再下载真正需要显示的图片。 在 Html 文档中标注 “low source” 的方法为:〈 img src=需要显示的图片 lowsrc=预览图 width=x height=y〉 (其中 width 和 height 是需要显示的图片的宽度和高度。 如果不加 width 和 height 属性,浏览器视为以较小图片作为长宽尺寸。 ) 实现 “ 预览图 ” 还有一个方法,就是将预览图做成一个链接,如果用户愿意,可以点击它,再观看真正的图片,格式是: a href=需要显示的图片 img src=预览图 width=x height=y border=0/a 39,Q:闪亮的链接: A: a href=linkto name=link1 style=textdecoration:underline。 color:green。 闪亮的链接 /a script language=JavaScript ! 这段脚本放在链接的后面 function flashit() { if (!) return if (==green) =red else =green } setInterval(flashit(), 400) // /script 40,Q:在网页中添加 “ 添加到收藏夹 ”“ 设为首页 ” 功能 (似乎只能在 以上版本使用 ?): A:添加到收藏夹:〈 a href=javascript:(39。 39。 ,39。 说明 39。 )。 〉添加到收藏夹〈 /a〉 设为首页:〈 a href= onclick==39。 url(defaulthomepage)39。 (39。 39。 )。 〉设为首页〈 /a〉 41,Q:定制浏览器地址栏前的小图标: A:在网页的〈 head〉〈 /head〉间加入以下语句:〈 link rel=shortcuticon href= 〉即可。 其中 为 16x16 的图标文件,颜色不要超过 16 色。 42,Q:给超链接、表单 、表格等网页元素加上动态说明: A:网页中的图片可以用〈 img alt=说明 〉 加上注释,其它元素页可以加上注释说明,方法是用 title 属性。 如: 〈 a href= title=说明 〉;〈 input title=说明 〉;〈 table title=说明 〉 „ 〈 /table〉 43,Q:用曾叠式样式表 (css)定制按钮的鼠标形状 (cursor): A:input type=button style=cursor:hand。 ,这样,当鼠标移到按钮上 时,会变成一个 “ 手 ” 形,和移到超级链接上一样。 cursor 后的参数很多,列在下边:。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。