网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

JQuery和html+css怎么实现带小圆点和左右按钮

这篇文章给大家分享的是有关JQuery和html+css怎么实现带小圆点和左右按钮的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。

目前创新互联公司已为上千家的企业提供了网站建设、域名、雅安服务器托管、网站托管维护、企业网站设计、苏家屯网站维护等服务,公司将坚持客户导向、应用为本的策略,正道将秉承"和谐、参与、激情"的文化,与客户和合作伙伴齐心协力一起成长,共同发展。

CSS代码:

/*轮播图 左右按钮 小白点*/
  #second_div{
  margin-top: 160px;
  }
  .img_box{
  overflow: hidden;
  width:100%;
  height:420px;
  border:1px solid;
  position:relative;
 }  
  .img_box img{
  width:100%;
  position:absolute;
 }  
  .ul5{
  list-style: none;
  position:absolute;
  left:580px;
  top:565px;
  } 
  .ul5 li{
  float:left;
  margin-left:20px;
  width:40px;
  height:5px;
  border:0px;
  background:lawngreen;
 }
  .d1,.d2{
  width:50px;
  height:60px;
  background-color: rgba(10,10,10,0.5);
  text-align: center;
  font-size:26px;
  font-weight: 800px;
  line-height:60px;
  cursor: pointer;
  }
  .d1{
  position:absolute;
  top:373px;
  left:25px;
  }
  .d2{
  position:absolute;
  top:373px;
  left:1445px;
  }

HTML代码:




 
 
 
 
     
  •  
  •  
  •  
  •  <
     >

    js代码:

    
      $(document).ready(function(){
    //搜索按钮
     $("#ss").click(function(){
      var new_li = $("
  • "+ $("#skuang").val() +"
  • ");   $("#d1 ul").append(new_li);   $("#d1").hide();   $("#skuang").val("");   })   $("#skuang").focus(function(){    $("#d1").css("display","block");   });      $("#skuang").blur();   $("#qingch").click(function(){    $("#d1 li:gt(0)").remove();    $("#d1").hide();       }); //轮播图   var img=$(".img_box img");   var li=$(".ul5 li");   var divW=$(".img_box").width();   var len=$(".img_box img").length;   img.css("left",divW);   img.eq(0).css("left",0);   li.eq(0).css("background","red");   var index=0;   var next=0;   function show(){    next++;    if(next==len){     next=0;    }    img.eq(next).css("left",divW);    img.eq(index).animate({"left":-divW});    img.eq(next).animate({"left":0});    li.eq(next).css("background","red");    li.eq(index).css("background","lawngreen");    index=next;   }   t=setInterval(show,2000);   function show1(){    next--;    if(next==-1){     next=len-1;    }    img.eq(next).css("left",-divW);    img.eq(index).animate({"left":divW});    img.eq(next).animate({"left":0});    li.eq(next).css("background","red");    li.eq(index).css("background","lawngreen");    index=next;        }   img.hover(function(){    clearInterval(t);        },function(){    t=setInterval(show,2000);   })   //左右按钮   $(".d2").mousedown(function(){    clearInterval(t);    show();   })   $(".d2").mousedown(function(){      t=setInterval(show,2000);   })    $(".d1").mousedown(function(){    clearInterval(t);      show1();   })   $(".d1").mousedown(function(){    t=setInterval(show,2000);   })   //小白点 点击   li.mousedown(function(){    num=$(this).index();    if(num==next){     return;    }else if(numnext){     clearInterval(t);      img.eq(num).css("left",divW);      img.eq(index).animate({"left":-divW});      img.eq(num).animate({"left":0});      li.eq(num).css("background","red");      li.eq(index).css("background","lawngreen");      index=num;      next=num;    }  })     li.mouseup(function(){      t=setInterval(show,2000);    })   })  

    感谢各位的阅读!关于“JQuery和html+css怎么实现带小圆点和左右按钮”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,让大家可以学到更多知识,如果觉得文章不错,可以把它分享出去让更多的人看到吧!


    网站题目:JQuery和html+css怎么实现带小圆点和左右按钮
    当前链接:http://bjjierui.cn/article/jgdeoo.html

    其他资讯