项目目标 项目结构 html导航条部分headerclassheaderulli首页lili品牌故事lili产品lili关于我们liulheaderbase。css 基础样式统一设置:{margin:0;padding:0;boxsizing:borderbox;}ul,ol,li{liststyle:none;}a{textdecoration:none;}清除浮动margin塌陷。clearfix::before,。clearfix::after{content:;display:table;}。clearfix::after{clear:both;}index。css导航条部分。header{width:100;height:87px;backgroundcolor:FDEDDC;zindex:999;overflow:hidden;position:fixed;}。headertopbar{width:80;height:75px;backgroundcolor:aquamarine;margin:auto;}。header。headertopbar。headertopbarlogo{width:104px;height:52px;backgroundcolor:blueviolet;margintop:18px;background:url(staticimageslogo1。png)norepeat;backgroundsize:cover;float:left;}。header。headertopbarul{width:80;height:60px;float:right;backgroundcolor:chocolate;marginright:40px;margintop:15px;}。header。headertopbarulli{width:20;float:left;lineheight:60px;fontsize:16px;position:relative;}。header。headertopbarullia{color:646464;position:relative;left:150px;}。header。headertopbarullia:hover{color:A30000;}轮播图原理 当前轮播图设置4张图片,通过绝对定位显示在相同位置,但是会出现重叠覆盖的情况,因此,定时器轮流选择图片,被选中图片显示,其他图片隐藏。 点击白色圆点和左右箭头也可以选择图片,当鼠标悬停在轮播图上停止轮播,鼠标离开继续轮播。html轮播图部分imgsrca2020imgdataimg。jpgdatasrcimg03。bs178。comcckhbae17c97f9b7e567。jpgaltidbannerimglist01imgsrca2020imgdataimg。jpgdatasrcimg03。bs178。comcckh1351c3664397ad5d。jpgaltidbannerimglist02imgsrca2020imgdataimg。jpgdatasrcimg03。bs178。comcckh465b9726bc047eea。jpgaltidbannerimglist03imgsrca2020imgdataimg。jpgdatasrcimg03。bs178。comcckhadc8cc1212a97c97。jpgaltidbannerimglist04ulclassbannerdotlistlilililililililiulspanclassbannerprespanspanclassbannernextspanindex。css轮播图部分轮播图。banner{width:100;position:relative;}。bannerimglist{width:100;position:relative;}。bannerimglistimg{width:100;height:100;width:20;position:absolute;}轮播图底部圆点。bannerdotlist{width:100px;height:15px;backgroundcolor:white;zindex:2;position:absolute;left:50;top:630px;marginleft:50px;}。bannerdotlistli{width:15px;height:15px;border:1pxsolidwhite;borderradius:50;float:left;marginleft:10px;cursor:pointer;}pre和next按钮。bannerpre,。bannernext{display:block;width:40px;height:40px;border:1pxsolidwhite;textalign:center;lineheight:35px;fontsize:30px;position:absolute;zindex:2;top:360px;margintop:25px;color:white;borderradius:50;}。bannerpre{left:40px;}。bannernext{right:40px;}js轮播图部分functionchangebanner(currentselectidx){(。bannerimglistimg)。eq(currentselectidx)。fadeIn(500)。siblings()。fadeOut(100);(。bannerdotlistli)。eq(currentselectidx)。css({backgroundColor:white})。siblings()。css({backgroundColor:});}letcurrentselectidx0;当前选择图片序号letbannertimernull;letallimgscnt(。bannerimglist)。children()。length;console。log(allimgscnt);letbannerimglist(。bannerimglist);bannerimglist。offset({top:50});changebanner(currentselectidx);functionstartTimer(){bannertimersetInterval(function(){currentselectidx(currentselectidx1)allimgscnt;changebanner(currentselectidx);},3600);}functionmain(){startTimer();(。bannerimglist)。mouseover(function(){clearInterval(bannertimer);});(。bannerimglist)。mouseleave(function(){startTimer();});(。bannerpre)。click(function(){currentselectidx1;if(currentselectidx1)currentselectidxallimgscnt1;changebanner(currentselectidx);});(。bannernext)。click(function(){currentselectidx1;if(currentselectidxallimgscnt)currentselectidx0;changebanner(currentselectidx);});(。bannerdotlistli)。click(function(){letindex(this)。index();alert(index);changebanner(index);});}export{main}导航条视频讲解 视频加载中。。。