首页 / JAVA / javaScript特效
javaScript特效
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了javaScript特效,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含4890字,纯文字阅读大概需要7分钟。
内容图文
![javaScript特效](/upload/InfoBanner/zyjiaocheng/1334/6427b5ae6fa54b58af53472a21582177.jpg)
![技术分享](/upload/getfiles/default/2022/11/9/20221109034720555.jpg)
![技术分享](/upload/getfiles/default/2022/11/9/20221109034720572.jpg)
<! DOCTYPE html > < html > < head lang ="en" > < meta charset ="UTF-8" > < title ></ title > </ head > < body > < h1 >第一个界面</h1><a href="js02history.html">当前页面</a><a href="js03history.html">下一个页面</a><a href="javascript:history.forward()">forward()前进一个界面</a><a href="javascript:history.go(1)">go(1)前进一个界面</a></body></html>
![技术分享](/upload/getfiles/default/2022/11/9/20221109034720555.jpg)
![技术分享](/upload/getfiles/default/2022/11/9/20221109034720572.jpg)
<! DOCTYPE html > < html > < head lang ="en" > < meta charset ="UTF-8" > < title ></ title > </ head > < body > < h1 >第二个界面</h1><a href="javascript:history.back()">back()后退一个界面</a><a href="javascript:history.go(-1)">go(-1)后退一个界面</a></body></html>
![技术分享](/upload/getfiles/default/2022/11/9/20221109034720555.jpg)
![技术分享](/upload/getfiles/default/2022/11/9/20221109034720572.jpg)
<! DOCTYPE html > < html > < head lang ="en" > < meta charset ="UTF-8" > < title ></ title > < script type ="text/javascript" > document.write( " host值为: " + location.host + " <br/> " ) document.write( " hostname值为: " + location.hostname + " <br/> " ) document.write( " href值为: " + location.href + " <br/> " ) document.write( " hash值为: " + location.hash + " <br/> " ) document.write( " search值为: " + location.search + " <br/> " ) </ script > </ head > < body > < input type ="text" > < input type ="button" value ="刷新当前页面" onclick ="location.reload()" > < input type ="button" value ="替换当前页面" onclick ="location.replace(‘http://www.bdqn.cn‘)" > </ body > </ html >
![技术分享](/upload/getfiles/default/2022/11/9/20221109034720555.jpg)
![技术分享](/upload/getfiles/default/2022/11/9/20221109034720572.jpg)
<! DOCTYPE html > < html > < head lang ="en" > < meta charset ="UTF-8" > < title ></ title > < style type ="text/css" > body { font-size : 14px ; line-height : 30px ; } input { margin : 1px ; width : 90px ; font-size : 12px ; padding : 0 ; } #node { width : 100px ; font-size : 24px ; font-weight : bold ; float : left ; } </ style > < script type ="text/javascript" > /* 改变层内容 */ function changeLink(){ document.getElementById( " node " ).innerHTML = " <h1>改变</h1> " ; // document.getElementById("node").innerText="<h1>改变</h1>"; } /* 获取所有input标签中所有的value */ function all_input(){ var allInput = document.getElementsByTagName( " input " ); /* 声明变量 接收所有input标签中所有的value */ var str = "" ; for ( var i = 0 ;i < allInput.length;i ++ ){ str += allInput[i].value + " <br/> " ; } /* 把str获取的值 给 p标签 */ document.getElementById( " s " ).innerHTML = str; } /* 获取所有name属性值是season的value */ function s_input(){ var season = document.getElementsByName( " season " ); /* 声明变量 接收所有input标签中所有的value */ var str = "" ; for ( var i = 0 ;i < season.length;i ++ ){ str += season[i].value + " <br/> " ; } /* 把str获取的值 给 p标签 */ document.getElementById( " s " ).innerHTML = str; } </ script > </ head > < body > < div id ="node" >新浪</div><input name="b1" type="button" value="改变层内容" onclick="changeLink();"/><br /><br /><input name="season" type="text" value="春"/><input name="season" type="text" value="夏"/><input name="season" type="text" value="秋"/><input name="season" type="text" value="冬"/><br /><input name="b2" type="button" value="显示input内容" onclick="all_input()"/><input name="b3" type="button" value="显示season内容" onclick="s_input()"/><p id="s"></p></body></html>
![技术分享](/upload/getfiles/default/2022/11/9/20221109034720555.jpg)
![技术分享](/upload/getfiles/default/2022/11/9/20221109034720572.jpg)
<! DOCTYPE html > < html > < head lang ="en" > < meta charset ="UTF-8" > < title >window中的open()</title><script type="text/javascript">function openNew(){ window.open( "http://www.baidu.com", "百度页面", "height=400,width=400" ); } </script></head><body><input type="button" value="打开新的窗口" onclick="openNew()"></body></html>
![技术分享](/upload/getfiles/default/2022/11/9/20221109034720555.jpg)
![技术分享](/upload/getfiles/default/2022/11/9/20221109034720572.jpg)
<! DOCTYPE html > < html > < head lang ="en" > < meta charset ="UTF-8" > < title >定时函数</title><script type="text/javascript">var time=0; function count(){ //计数的方法 document.getElementById("context").innerHTML="时间:"+(++time); } var interval,timeout; //定时函数function setI(){ //setInterval函数 周期执行 interval=setInterval("count()",1000); } function setT(){ //setTimeout函数 执行一次 timeout= setTimeout("count()",1000); } //清除定时函数function clearI(){//清除setInterval函数 clearInterval(interval); } function clearT(){//清除setTimeout函数 clearTimeout(timeout); } </script></head><body><div id="context"></div><input type="button" value="setInterval函数" onclick="setI()"><input type="button" value="setTimeout函数" onclick="setT()"><br/><input type="button" value="清除setInterval函数" onclick="clearI()"><input type="button" value="清除setTimeout函数" onclick="clearT()"></body></html>
原文:http://www.cnblogs.com/999-/p/6189735.html
内容总结
以上是互联网集市为您收集整理的javaScript特效全部内容,希望文章能够帮你解决javaScript特效所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。