当前位置: 首页 > news >正文

网站建设具体步骤网站推广方案策划书2000

网站建设具体步骤,网站推广方案策划书2000,网站建设 提案 框架,社交网站设计目录 BOM对象的方法 定时器方法 短信验证码案例 计时器元素动画 同步代码和异步代码 location对象 跳转查询页面参数 跳转多查询参数 BOM对象的方法 // window.alert("提示");// window 中提供的方法和属性,可以在省略window对象的情况下直接调用…

目录

BOM对象的方法

定时器方法

短信验证码案例

计时器元素动画

同步代码和异步代码

location对象

跳转查询页面参数

跳转多查询参数


BOM对象的方法

// window.alert("提示");// window 中提供的方法和属性,可以在省略window对象的情况下直接调用//      BOM对象的属性和方法的使用// alert("提示");// window.onload = function(){//     // 监控BOM对象的资源加载,当资源加载完成后执行//     var h1Dom = document.querySelector("#title");//     console.log(h1Dom);// }// window.addEventListener("load",function(){//     var h1Dom = document.querySelector("#title");//     console.log(h1Dom);// })window.addEventListener("DOMContentLoaded",function(){var h1Dom = document.querySelector("#title");console.log(h1Dom);})window.onresize = function(){// 当浏览器窗口发生变化时会执行的事件//      监控的时浏览器加载的DOM显示区域的大小变化console.log("窗口大小改变了");}


        


定时器方法

<input type="button" value="3s内关闭一次性计时器" onclick="closeTimeout()"><input type="button" value="关闭周期计时器" onclick="closeTimerInterval()"><script>// var timer = setTimeout(回调方法,时间ms); 一次性计时器,完成一次执行代码的延迟操作//             方法会返回一个计时器控制对象(timer) => 浏览器输出的结果是编号,该值实际上是一个控制对象// clearTimeout(计时器对象) : 一次计时器的关闭// console.log(1);var timer1 = setTimeout(function(){// 3秒之后执行console.log(2);},3000);console.log("timer1:",timer1);function closeTimeout(){clearTimeout(timer1)}// var timer = setInterval(回调方法,时间ms); 周期性计时器,在设置的时间间隔上多次执行,需要手动停止//             方法会返回一个计时器控制对象(timer) => 浏览器输出的结果是编号,该值实际上是一个控制对象// clearInterval(计时器) : 关闭周期性计时器var timer2 = setInterval(function(){console.log(3);},1000);console.log("timer2:",timer2);function closeTimerInterval(){clearInterval(timer2);}</script>

短信验证码案例

 <input type="text"><input type="button" value="获取验证码" id="btn"><script>var btnDom = document.querySelector("#btn")btnDom.addEventListener("click",function getCode(){var code = Math.ceil( Math.random()*10000 );console.log(code);// 禁用按钮 => 视觉禁止btnDom.disabled = true;var max = 5;btnDom.value = max+"s后获取验证码"// 彻底删除方法 => 功能禁用btnDom.removeEventListener("click",getCode);// 倒计时// setTimeout(function(){//     btnDom.disabled = false;//     btnDom.addEventListener("click",getCode)// }, 3000);var i = 1;var timer = setInterval(function(){console.log("计时器");btnDom.value = (max-i)+"s后获取验证码";if(i>=max){btnDom.disabled = false;btnDom.addEventListener("click",getCode);btnDom.value = "获取验证码"clearInterval(timer);}i++;},1000)})</script>


计时器元素动画

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Document</title><style>.ball{padding: 0px;width: 50px;height: 50px;background-color: brown;border-radius: 50%;margin-left: 0px;margin-top: 10px;}.ball1{/* 不能分段执行的动画 */transition:all 3s ease;}.right{width: 30px;height: 30px;margin-left: 400px;background-color: blueviolet;/* display: none; *//* visibility: hidden; */}.ball2{animation:move2 3s ease forwards;}/* @keyframes 时间为主先分段,样式为辅看定义 */@keyframes move2 {0%{/* 0s样式-动画执行前的初始样式 => 可不写 */width: 50px;height: 50px;margin-left: 0px;background-color: brown;}50%{/* 1.5s样式 */margin-left: 400px;width: 30px;height: 30px;background-color: brown;}100%{/* 3s样式-动画执行后的最终样式 => 可不写  */background-color: blueviolet;width: 30px;height: 30px;margin-left: 400px;}}</style>
</head>
<body><input type="button" value="添加样式ball1" onclick="moveFun1()"><input type="button" value="添加样式ball2" onclick="moveFun2()"><!-- 复习CSS动画 --><!-- CSS动画,通过特性元素规则触发的动画 --><div class="ball ball1" id="ball1"></div><div class="ball" id="ball2"></div><div class="ball ball2" ></div><script>function moveFun1(){var ballDom = document.querySelector("#ball1");ballDom.classList.add("right")}function moveFun2(){var ballDom = document.querySelector("#ball2")ballDom.classList.add("ball2")}</script><hr><input type="button" value="基于计时器的动画" onclick="moveFun3()"><div class="ball" id="ball3"></div><!-- 优先CSS --><script>function moveFun3(){var ballDom = document.querySelector("#ball3");// ballDom.style.marginLeft = "100px";// setTimeout(function(){//     ballDom.style.marginLeft = "101px";// },20)var start = 0;ballDom.style.marginLeft = start+"px";var timer = setInterval(function(){start++;if(start==200){alert("动画执行一半")}if(start>=400){clearInterval(timer);ballDom.style.display = "none";}else{ballDom.style.marginLeft = start+"px";}},8)}</script>
</body>
</html>

同步代码和异步代码

 <input type="button" value="执行同步代码" onclick="execFunA()"><input type="button" value="执行异步代码" onclick="execFunB()"><script>// 同步代码:代码按照顺序执行,前置代码没有完成,后续代码无法执行// console.log(1);// console.log(2);// console.log(3);// var res = num + 10;// console.log(4);// console.log(5);// console.log(6);// console.log(7);function execFunA(){console.log(1);console.log(2);console.log(3);var res = num + 10;console.log(4);console.log(5);console.log(6);console.log(7);}// 异步代码:按照代码顺序加载代码,但代码会延迟执行,且不会影响后续代码的执行//          异步内部的执行代码依然同步规则//          异步代码的回调方法,无法通过 return 返回结果// console.log(11);// console.log(22);// setTimeout(function(){//     console.log("计时器异步代码1");//     var res2 = arg + 10;//     console.log("计时器异步代码2");// },1000);// console.log(33);// console.log(44);function execFunB(){console.log(11);console.log(22);setTimeout(function(){console.log("计时器异步代码1");var res2 = arg + 10;console.log("计时器异步代码2");},1000);console.log(33);console.log(44);}</script>


location对象

   <h1 id="abc">头部</h1><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><a href="#abc">回到顶部</a><h1 id="end">底部</h1><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><script>// location 对象记录当前页面在浏览器地址中的指向路径//          地址指向路径 => 域名// 域名的组成 => URL 统一资源定位符//    protocol: // hostname[:port] / path / path / resource #anchor  ?query//     协议:     //  域名(ip:端口) /         路径-资源         #锚点     ?参数// //    + 协议://域名(ip:端口)/路径-资源   => 访问指定服务器的相关文件//    + #锚点   => 将访问的HTML页面滚动到对应的ID指向的标签console.log(location);function gotoPage(){var num = Math.random();console.log(num);if(num>0.5){// 改变浏览器窗口的地址location.href = "https://www.baidu.com";}}</script><hr><input type="button" value="切换页面" onclick="gotoPage()"><br><br><!-- 参数 不合法 --><a href="./16.跳转查寻参数页面.html?第一段文本">跳转到 16.跳转查寻参数页面.html-第一段文本</a><br><a href="./16.跳转查寻参数页面.html?第二段文本">跳转到 16.跳转查寻参数页面.html-第二段文本</a><br><!-- 参数规则和格式?名称1=参数1&名称2=参数2&……?key=value&key=value地址和参数之间通过 ? 分割参数和参数之间通过 & 分割参数名和参数值之间通过 = 分割--><a href="./16.跳转多查询参数.html?name=张三&age=23">跳转到 16.跳转多查询参数.html?name=张三&age=23</a>

跳转查询页面参数

<h3>跳转到页面,用于参数解析</h3><h4 id="title">内容-????</h4><script>console.log(location);console.log(location.href);console.log( decodeURI(location.href) );// location.search 当前页面访问时,地址栏中?后续的参数数据//    => location 中记录的数据不能出现非英文和符号以外其它字符//                如果存在其它字符串,该字符会被编码成ISO8859-1规则//                提供解码和编码方法//                  decodeURI( 编码后的字符 ) 解码都只会对不地址栏不识别的字符进行操作//                  encodeURI( 原始字符 ) 编码都只会对不地址栏不识别的字符进行操作console.log(location.search);var word = decodeURI( location.search );console.log(word);word = word.replace("?","");console.log(word);var titleDom = document.querySelector("#title");titleDom.innerHTML = "内容-" + word;</script>


跳转多查询参数

<h1>解析参数</h1><script>// 获取地址参数,并解码var search = decodeURI( location.search );console.log(search);// 删除参数开始的 ? 分割符search = search.replace("?","");// 分割多个参数var params = search.split("&");console.log(params);var obj = {};for (var i = 0; i < params.length; i++) {var p = params[i].split("=");console.log(p);console.log(p[0]);console.log(p[1]);obj[ p[0] ] = p[1];}console.log(obj);</script>


文章转载自:
http://dinncoendogamous.wbqt.cn
http://dinncourl.wbqt.cn
http://dinncoalbigensianism.wbqt.cn
http://dinncocompellent.wbqt.cn
http://dinncoassumingly.wbqt.cn
http://dinncolinecut.wbqt.cn
http://dinncoslim.wbqt.cn
http://dinncoclaustration.wbqt.cn
http://dinncocounterpole.wbqt.cn
http://dinncobesmear.wbqt.cn
http://dinncosilverside.wbqt.cn
http://dinncofumitory.wbqt.cn
http://dinncoattitudinarian.wbqt.cn
http://dinncosuperempirical.wbqt.cn
http://dinncotemperately.wbqt.cn
http://dinncogudrun.wbqt.cn
http://dinncolxv.wbqt.cn
http://dinncomonazite.wbqt.cn
http://dinncotalent.wbqt.cn
http://dinncoqic.wbqt.cn
http://dinncolimnic.wbqt.cn
http://dinncoelectrosensory.wbqt.cn
http://dinncoshrewish.wbqt.cn
http://dinncoeventual.wbqt.cn
http://dinncospringer.wbqt.cn
http://dinncofirmamental.wbqt.cn
http://dinncoslice.wbqt.cn
http://dinncomiddleweight.wbqt.cn
http://dinncounforgiving.wbqt.cn
http://dinncoillyrian.wbqt.cn
http://dinncoprepotent.wbqt.cn
http://dinncoredivivus.wbqt.cn
http://dinncotinamou.wbqt.cn
http://dinncoinniskilling.wbqt.cn
http://dinncosickroom.wbqt.cn
http://dinncomanxwoman.wbqt.cn
http://dinncosatinpod.wbqt.cn
http://dinncoparallelveined.wbqt.cn
http://dinncorusalka.wbqt.cn
http://dinncotwoscore.wbqt.cn
http://dinncotransitory.wbqt.cn
http://dinncohermaphrodism.wbqt.cn
http://dinncocenis.wbqt.cn
http://dinncojacobinize.wbqt.cn
http://dinncoschmoll.wbqt.cn
http://dinncodemoniacally.wbqt.cn
http://dinncokattegat.wbqt.cn
http://dinncomaladapt.wbqt.cn
http://dinncoloyalist.wbqt.cn
http://dinncoliberationist.wbqt.cn
http://dinncoreconnoissance.wbqt.cn
http://dinncograndparent.wbqt.cn
http://dinncowaftage.wbqt.cn
http://dinncoimmanency.wbqt.cn
http://dinncohumiture.wbqt.cn
http://dinncojillion.wbqt.cn
http://dinncoeuhemeristically.wbqt.cn
http://dinncotranslate.wbqt.cn
http://dinncomandira.wbqt.cn
http://dinncoindissoluble.wbqt.cn
http://dinncorockies.wbqt.cn
http://dinncoprimp.wbqt.cn
http://dinncosacroiliac.wbqt.cn
http://dinncoshield.wbqt.cn
http://dinncoflammenwerfer.wbqt.cn
http://dinncoaltitude.wbqt.cn
http://dinncoimbolden.wbqt.cn
http://dinncochauffeur.wbqt.cn
http://dinncoeta.wbqt.cn
http://dinncoheteronomous.wbqt.cn
http://dinncoregnum.wbqt.cn
http://dinncoaphrodisiacal.wbqt.cn
http://dinncosubspeciation.wbqt.cn
http://dinncofriday.wbqt.cn
http://dinncozaratite.wbqt.cn
http://dinncoantecedent.wbqt.cn
http://dinncodiphosgene.wbqt.cn
http://dinncosmaltine.wbqt.cn
http://dinncocanis.wbqt.cn
http://dinncoaviate.wbqt.cn
http://dinncodiketone.wbqt.cn
http://dinncooptimum.wbqt.cn
http://dinncowept.wbqt.cn
http://dinncomilano.wbqt.cn
http://dinncohereinafter.wbqt.cn
http://dinncoquestioning.wbqt.cn
http://dinncovanadinite.wbqt.cn
http://dinncoworrit.wbqt.cn
http://dinncounitrust.wbqt.cn
http://dinncoottar.wbqt.cn
http://dinncomasterpiece.wbqt.cn
http://dinncotectum.wbqt.cn
http://dinncoalgometer.wbqt.cn
http://dinncospathal.wbqt.cn
http://dinncolyriform.wbqt.cn
http://dinncoursiform.wbqt.cn
http://dinncolager.wbqt.cn
http://dinncosubplot.wbqt.cn
http://dinncotobacconist.wbqt.cn
http://dinncoshadbush.wbqt.cn
http://www.dinnco.com/news/117505.html

相关文章:

  • 沈阳网站开发公司哪些店铺适合交换友情链接
  • 保定php网站制作搜索引擎网络推广方法
  • 荧光字网站下载优化大师app
  • 网站建设工作室门头微信引流推广
  • 赣州网站建设多少钱郑州关键词seo
  • 信息发布网站怎么做站优云seo优化
  • 选择荣胜网络宁波网站建设美国婚恋网站排名
  • 自己做的网站图片打开慢百度搜索引擎的网址是
  • wordpress 新建分类页面网站搜索排优化怎么做
  • 国外的网站建设sem公司
  • 标准个人简历模板免费下载泰安网站优化公司
  • 室内设计师多少钱一个月厦门零基础学seo
  • 淄博张店网站排名优化qq群推广网站
  • wp网站如何做文件的付费下载seo外包一共多少钱
  • 怎么做视频监控的网站个人网站设计
  • wordpress下载视频播放器成都网站seo服务
  • 2020中国企业500强榜单seo搜索引擎优化是通过优化答案
  • 旅游网站盈利模式怎么做百度注册
  • 合肥企业网站排名优化免费网络推广的方法
  • 建设银行反钓鱼网站备案查询站长工具
  • 网页制作素材搜索途径有哪些如何做网站搜索引擎优化
  • 通州 网站建设百度电脑版网页版
  • 个人制作网站多少钱竞价推广账户竞价托管费用
  • 厦门做网站最好的公司有哪些平台推广员是做什么的
  • 宝安中心做网站郑州seo顾问热狗hotdoger
  • 中国建筑网信息网广州seo学徒
  • 国产wordpress主题seo的概念是什么
  • 建设工程合同管理网站网络营销怎么推广
  • 中国十大设计名校seo自媒体培训
  • 工程项目建设流程网站优化是做什么的