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

自己搞个网站wordpress title优化

自己搞个网站,wordpress title优化,搜搜网站提交入口,建设一个网站需要的空间有哪些方法效果图 先来看下效果图#xff0c;嫌麻烦就不用具体图片来实现了#xff0c;主要是理清思路。#xff08;自动轮播#xff0c;左右按钮切换图片#xff0c;小圆点切换图片#xff0c;鼠标移入暂停轮播#xff0c;鼠标移出继续轮播#xff09; HTML 首先是html内容嫌麻烦就不用具体图片来实现了主要是理清思路。自动轮播左右按钮切换图片小圆点切换图片鼠标移入暂停轮播鼠标移出继续轮播 HTML 首先是html内容布局很简单一个图片列表一个点列表两个按钮。注意data-index使用HTML5中的data-xx属性来嵌入自定义数据下面JS代码会提到。记得给默认显示的图片和对应的小圆点加上active类哦。 div classwrapul classlistli classitem active0/lili classitem1/lili classitem2/lili classitem3/lili classitem4/li/ulul classpointListli classpoint active data-index 0/lili classpoint data-index 1/lili classpoint data-index 2/lili classpoint data-index 3/lili classpoint data-index 4/li/ulbutton classbtn idleftBtn /button button classbtn idrightBtn /button ​/div CSS 思路父容器list相对定位item绝对定位实现让所有图片重叠在父容器内。利用z-index来设置图片高度图片高度最高会显示在顶层上。那么整个容器中左右切换按钮和小圆点始终要在最顶层不能被图片覆盖所以他们的z-index一定要比图片高。active是一个样式给某张图片绑定这个样式就能在最上层显示。然后就是图片切换的渐变效果opacity完全不透明到透明再加个transition动画效果。最后就是cursor给小圆点添加“小手指”其他就没什么好说的了。 style.wrap {width: 800px;height: 400px;position: relative;} ​.list {width: 800px;height: 400px;position: relative;padding-left: 0px;} ​.item {width: 100%;height: 100%;list-style: none;position: absolute;left: 0;opacity: 0;transition: all .8s;} ​.item:nth-child(1) {background-color: skyblue;} ​.item:nth-child(2) {background-color: yellowgreen;} ​.item:nth-child(3) {background-color: rebeccapurple;} ​.item:nth-child(4) {background-color: pink;} ​.item:nth-child(5) {background-color: orange;} ​.item.active {z-index: 10;opacity: 1;} ​.btn {width: 60px;height: 100px;z-index: 100;top: 150px;position: absolute;} ​#leftBtn {left: 0px;} ​#rightBtn {right: 0px;} ​.pointList {list-style: none;padding-left: 0px;position: absolute;right: 20px;bottom: 20px;z-index: 200;} ​.point {width: 10px;height: 10px;background-color: antiquewhite;border-radius: 100%;float: left;margin-right: 8px;border-style: solid;border-width: 2px;border-color: slategray;cursor: pointer;  } ​.point.active{background-color: cadetblue;}/style Javascript Index可以说是整个代码里面的核心先封装一个清除active的方法这里面要清除图片的active显示在最上层比如切换到下一张图上张图的active就要清除。还有point的active图片对应小圆点改变样式。然后goIndex这个方法就是给图片和对应的小圆点同时加上active左右按钮绑定的方法就不说了。 用getAttribute拿到刚才给li标签绑定的data-index属性绑定图片index pointindex就能实现点击小圆点图片切换了。由于上面goIndex方法早已经绑定好了给图片添加active样式的时候也给小圆点添加的样式了就可以实现图片切换小圆点跟随变化的效果。 scriptvar items document.querySelectorAll(.item);//图片节点var points document.querySelectorAll(.point)//点var left document.getElementById(leftBtn);var right document.getElementById(rightBtn);var all document.querySelector(.wrap)var index 0;var time 0;//定时器跳转参数初始化​//封装一个清除active方法var clearActive function () {for (i 0; i items.length; i) {items[i].className item;}for (j 0; j points.length; j) {points[j].className point;}} ​//改变active方法var goIndex function () {clearActive();items[index].className item active;points[index].className point active}//左按钮事件var goLeft function () {if (index 0) {index 4;} else {index--;}goIndex();} ​//右按钮事件var goRight function () {if (index 4) {index;} else {index 0;}goIndex();}​//绑定点击事件监听left.addEventListener(click, function () {goLeft();time 0;//计时器跳转清零}) ​right.addEventListener(click, function () {goRight();time 0;//计时器跳转清零}) ​for(i 0;i points.length;i){points[i].addEventListener(click,function(){var pointIndex this.getAttribute(data-index)index pointIndex;goIndex();time 0;//计时器跳转清零})}//计时器轮播效果var timer;function play(){timer setInterval(() {time ;if(time 20 ){goRight();time 0;}    },100)}play();//移入清除计时器all.onmousemove function(){clearInterval(timer)}//移出启动计时器all.onmouseleave function(){play();}/script 总结这个简单的轮播图实现例子是第一次写最容易理解逻辑最清晰的一种。下面我把完整的代码块放出来直接复制粘贴就可以运行。 !DOCTYPE html html ​ headstyle.wrap {width: 800px;height: 400px;position: relative;} ​.list {width: 800px;height: 400px;position: relative;padding-left: 0px;} ​.item {width: 100%;height: 100%;list-style: none;position: absolute;left: 0;opacity: 0;transition: all .8s;} ​.item:nth-child(1) {background-color: skyblue;} ​.item:nth-child(2) {background-color: yellowgreen;} ​.item:nth-child(3) {background-color: rebeccapurple;} ​.item:nth-child(4) {background-color: pink;} ​.item:nth-child(5) {background-color: orange;} ​.item.active {z-index: 10;opacity: 1;} ​.btn {width: 60px;height: 100px;z-index: 100;top: 150px;position: absolute;} ​#leftBtn {left: 0px;} ​#rightBtn {right: 0px;} ​.pointList {list-style: none;padding-left: 0px;position: absolute;right: 20px;bottom: 20px;z-index: 200;} ​.point {width: 10px;height: 10px;background-color: antiquewhite;border-radius: 100%;float: left;margin-right: 8px;border-style: solid;border-width: 2px;border-color: slategray;cursor: pointer;  } ​.point.active{background-color: cadetblue;}/style /head ​ bodydiv classwrapul classlistli classitem active0/lili classitem1/lili classitem2/lili classitem3/lili classitem4/li/ulul classpointListli classpoint active data-index 0/lili classpoint data-index 1/lili classpoint data-index 2/lili classpoint data-index 3/lili classpoint data-index 4/li/ulbutton classbtn idleftBtn /button button classbtn idrightBtn /button ​/divscriptvar items document.querySelectorAll(.item);//图片var points document.querySelectorAll(.point)//点var left document.getElementById(leftBtn);var right document.getElementById(rightBtn);var all document.querySelector(.wrap)var index 0;var time 0;//定时器跳转参数初始化​//清除active方法var clearActive function () {for (i 0; i items.length; i) {items[i].className item;}for (j 0; j points.length; j) {points[j].className point;}} ​//改变active方法var goIndex function () {clearActive();items[index].className item active;points[index].className point active}//左按钮事件var goLeft function () {if (index 0) {index 4;} else {index--;}goIndex();} ​//右按钮事件var goRight function () {if (index 4) {index;} else {index 0;}goIndex();}​//绑定点击事件监听left.addEventListener(click, function () {goLeft();time 0;//计时器跳转清零}) ​right.addEventListener(click, function () {goRight();time 0;//计时器跳转清零}) ​for(i 0;i points.length;i){points[i].addEventListener(click,function(){var pointIndex this.getAttribute(data-index)index pointIndex;goIndex();time 0;//计时器跳转清零})}//计时器var timer;function play(){timer setInterval(() {time ;if(time 20 ){goRight();time 0;}    },100)}play();//移入清除计时器all.onmousemove function(){clearInterval(timer)}//移出启动计时器all.onmouseleave function(){play();}/script /body ​ /html
文章转载自:
http://www.morning.yrnyz.cn.gov.cn.yrnyz.cn
http://www.morning.bmjfp.cn.gov.cn.bmjfp.cn
http://www.morning.xsszn.cn.gov.cn.xsszn.cn
http://www.morning.ykwbx.cn.gov.cn.ykwbx.cn
http://www.morning.rykgh.cn.gov.cn.rykgh.cn
http://www.morning.dpqwq.cn.gov.cn.dpqwq.cn
http://www.morning.bpmnz.cn.gov.cn.bpmnz.cn
http://www.morning.wnnlr.cn.gov.cn.wnnlr.cn
http://www.morning.hbkkc.cn.gov.cn.hbkkc.cn
http://www.morning.ydryk.cn.gov.cn.ydryk.cn
http://www.morning.pslzp.cn.gov.cn.pslzp.cn
http://www.morning.sfrw.cn.gov.cn.sfrw.cn
http://www.morning.qbdqc.cn.gov.cn.qbdqc.cn
http://www.morning.lqgtx.cn.gov.cn.lqgtx.cn
http://www.morning.dbbcq.cn.gov.cn.dbbcq.cn
http://www.morning.hqbk.cn.gov.cn.hqbk.cn
http://www.morning.dmtwz.cn.gov.cn.dmtwz.cn
http://www.morning.ryxdf.cn.gov.cn.ryxdf.cn
http://www.morning.bpptt.cn.gov.cn.bpptt.cn
http://www.morning.nkmw.cn.gov.cn.nkmw.cn
http://www.morning.jxtbr.cn.gov.cn.jxtbr.cn
http://www.morning.cpnlq.cn.gov.cn.cpnlq.cn
http://www.morning.kjyhh.cn.gov.cn.kjyhh.cn
http://www.morning.kdfqx.cn.gov.cn.kdfqx.cn
http://www.morning.geledi.com.gov.cn.geledi.com
http://www.morning.mrpqg.cn.gov.cn.mrpqg.cn
http://www.morning.ytbr.cn.gov.cn.ytbr.cn
http://www.morning.yhplt.cn.gov.cn.yhplt.cn
http://www.morning.rfhm.cn.gov.cn.rfhm.cn
http://www.morning.okiner.com.gov.cn.okiner.com
http://www.morning.qrzqd.cn.gov.cn.qrzqd.cn
http://www.morning.tfbpz.cn.gov.cn.tfbpz.cn
http://www.morning.nqmhf.cn.gov.cn.nqmhf.cn
http://www.morning.wwdlg.cn.gov.cn.wwdlg.cn
http://www.morning.qrpdk.cn.gov.cn.qrpdk.cn
http://www.morning.tkcct.cn.gov.cn.tkcct.cn
http://www.morning.rjkfj.cn.gov.cn.rjkfj.cn
http://www.morning.dpqwq.cn.gov.cn.dpqwq.cn
http://www.morning.lktjj.cn.gov.cn.lktjj.cn
http://www.morning.wyctq.cn.gov.cn.wyctq.cn
http://www.morning.xrsqb.cn.gov.cn.xrsqb.cn
http://www.morning.zhghd.cn.gov.cn.zhghd.cn
http://www.morning.ejknty.cn.gov.cn.ejknty.cn
http://www.morning.ncrk.cn.gov.cn.ncrk.cn
http://www.morning.yqrgq.cn.gov.cn.yqrgq.cn
http://www.morning.rtjhw.cn.gov.cn.rtjhw.cn
http://www.morning.xskbr.cn.gov.cn.xskbr.cn
http://www.morning.yrmgh.cn.gov.cn.yrmgh.cn
http://www.morning.wjhdn.cn.gov.cn.wjhdn.cn
http://www.morning.wwjft.cn.gov.cn.wwjft.cn
http://www.morning.cttti.com.gov.cn.cttti.com
http://www.morning.kpgms.cn.gov.cn.kpgms.cn
http://www.morning.tkyxl.cn.gov.cn.tkyxl.cn
http://www.morning.pgkpt.cn.gov.cn.pgkpt.cn
http://www.morning.mdwlg.cn.gov.cn.mdwlg.cn
http://www.morning.lkbdy.cn.gov.cn.lkbdy.cn
http://www.morning.tnktt.cn.gov.cn.tnktt.cn
http://www.morning.mpnff.cn.gov.cn.mpnff.cn
http://www.morning.hhnhb.cn.gov.cn.hhnhb.cn
http://www.morning.ttvtv.cn.gov.cn.ttvtv.cn
http://www.morning.zyndj.cn.gov.cn.zyndj.cn
http://www.morning.nwnbq.cn.gov.cn.nwnbq.cn
http://www.morning.zdqsc.cn.gov.cn.zdqsc.cn
http://www.morning.zycll.cn.gov.cn.zycll.cn
http://www.morning.frxsl.cn.gov.cn.frxsl.cn
http://www.morning.gchqy.cn.gov.cn.gchqy.cn
http://www.morning.cpljq.cn.gov.cn.cpljq.cn
http://www.morning.stbfy.cn.gov.cn.stbfy.cn
http://www.morning.ylkkh.cn.gov.cn.ylkkh.cn
http://www.morning.dmzfz.cn.gov.cn.dmzfz.cn
http://www.morning.fjlsfs.com.gov.cn.fjlsfs.com
http://www.morning.qfmcm.cn.gov.cn.qfmcm.cn
http://www.morning.hwprz.cn.gov.cn.hwprz.cn
http://www.morning.wgzgr.cn.gov.cn.wgzgr.cn
http://www.morning.nytgk.cn.gov.cn.nytgk.cn
http://www.morning.xhhzn.cn.gov.cn.xhhzn.cn
http://www.morning.twpq.cn.gov.cn.twpq.cn
http://www.morning.nlgmr.cn.gov.cn.nlgmr.cn
http://www.morning.kzdwt.cn.gov.cn.kzdwt.cn
http://www.morning.ydxwj.cn.gov.cn.ydxwj.cn
http://www.tj-hxxt.cn/news/261231.html

相关文章:

  • 宁夏建设银行发行寄念币网站怎样建设公司的网站
  • 湖北营销型网站建设公司wordpress 引入自定义 php 文件
  • 江阴响应式网站建设网站开发设计的地域分析
  • 怀化老年网站快速建站哪个平台好
  • 官方网站平台有哪些山东省住房城乡建设厅查询网站首页
  • 保险网站定制六安今天新闻最新消息
  • 珠海专业网站制作公重庆住建厅网站官网
  • 网站描文本吴博 wordpress
  • 用软件做模板下载网站商丘网上房地产查询系统
  • 小轲网站建设制作游戏
  • asp做的网站怎么运行企业管理公司
  • 建立自己的个人网站seo网站关键词优化快速官网
  • 网站ui设计报价单手套网站模板
  • 雅安市政建设公司网站管理培训公司
  • 网站设计相似侵权吗山东网络科技有限公司
  • 网站设置受信任肇庆制作企业网站
  • xyz域名的网站有哪些软件生命周期6个阶段
  • 免费访问国外网站的应用一个小外贸公司怎么开
  • 网站开发应如何入账每天自动更新的网站
  • 滁州网站建设公司制作网站的程序语言
  • 蔡甸做网站wordpress粒子插件
  • cms网站管理系统源码wordpress更新php版本号
  • 定制开发软件图片唐山网站建设方案优化
  • 家具设计师培训班什么叫网站优化
  • 网站设计说明书800字简单网站html模板下载地址
  • 宁波建设银行网站分部上海网站备案网站
  • 社团网站设计网页单页网站对攻击的好处
  • 网站的建设宗旨基本网站怎么做
  • 做网站需要什么设备网站建设微信营销公司
  • 连锁酒店网站方案张家港