实践的活动

master
zhoujian 5 years ago
parent 13aac3169e
commit b6fd755696

@ -7,9 +7,12 @@
<script src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
<script src="/axios.min.js"></script>
<script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<!--<script src="https://libs.baidu.com/jquery/1.10.2/jquery.min.js"></script>-->
<link rel="stylesheet" type="text/css" href="/index.css?640523">
<script src="__IMG__/lunbo/js.js" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" type="text/css" href="__IMG__/lunbo/css.css"/>
<link rel="stylesheet" href="__IMG__/lunbo/swiper.min.css">
<link rel="stylesheet" href="__IMG__/lunbo/demo.css">
<script src="__IMG__/lunbo/swiper.min.js"></script>
</head>
<body><div id="app" :class="bodyOver?'van-over':''" >
@ -17,29 +20,26 @@
<!--<img src="__IMG__/jimg1.png" style="width:100%;display: block" />-->
<!--轮播图开始-->
<div id="boxhdp">
<ul id="img">
<li class="current"><img src="__IMG__/lunbo/t1.png"></li>
<li><img src="__IMG__/lunbo/t2.png"></li>
<li><img src="__IMG__/lunbo/t3.png"></li>
<li><img src="__IMG__/lunbo/t4.png"></li>
<li><img src="__IMG__/lunbo/t5.png"></li>
</ul>
<ul id="li">
<li class="on"></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
<div style="clear: both;"></div>
<div class="an" id="an">
<a href="javascript:;" id="prev"><</a>
<a href="javascript:;" id="next" class="an-a2">></a>
<div class="swiper-container">
<div class="swiper-wrapper">
<div class="swiper-item"><img src="__IMG__/lunbo/t1.png" alt="banner"/></div>
<div class="swiper-item"><img src="__IMG__/lunbo/t2.png" alt="banner"/></div>
<div class="swiper-item"><img src="__IMG__/lunbo/t3.png" alt="banner"/></div>
<div class="swiper-item"><img src="__IMG__/lunbo/t4.png" alt="banner"/></div>
<div class="swiper-item"><img src="__IMG__/lunbo/t5.png" alt="banner"/></div>
<div class="swiper-item"><img src="__IMG__/lunbo/t6.png" alt="banner"/></div>
<div class="swiper-item"><img src="__IMG__/lunbo/t7.png" alt="banner"/></div>
<div class="swiper-item"><img src="__IMG__/lunbo/t8.png" alt="banner"/></div>
<div class="swiper-item"><img src="__IMG__/lunbo/t9.png" alt="banner"/></div>
<div class="swiper-item"><img src="__IMG__/lunbo/t10.png" alt="banner"/></div>
<div class="swiper-item"><img src="__IMG__/lunbo/t11.png" alt="banner"/></div>
<div class="swiper-item"><img src="__IMG__/lunbo/t12.png" alt="banner"/></div>
<div class="swiper-item"><img src="__IMG__/lunbo/t13.png" alt="banner"/></div>
<div class="swiper-item"><img src="__IMG__/lunbo/t14.png" alt="banner"/></div>
</div>
</div>
<!--轮播图-->
<!--轮播图结束-->
<div class="bottomDiv" style="padding-top: 20px;">
<div class="beforeCon">
<div class="title"><img src="__IMG__/icon2.png" />前言<img src="__IMG__/icon1.png" /></div>
@ -174,17 +174,6 @@
</div></body>
<script>
hdp({
li:"li", //默认值li;默认用li包裹
boxid:"boxhdp", //最外面div id
imgid:"img", //图片外面id
optid:"li", //opt外面id
an:"an", //左右按钮id用于移上显示和隐藏
prev:"prev", //左边箭头id
next:"next", //右边箭头id
ms:3000 //多少毫秒切换一张,默认800毫秒
})
new Vue({
el: '#app',
data: {
@ -369,6 +358,15 @@
for (var i = 0; i < $inputs.length; i++) {
listenKeybord($inputs[i]);
}
var myWidth=$(window).width()
$(".swiper-container").carousel({
width: myWidth,
height: myWidth/750*422,
speed: 3e3,
needPrevAndNextBtnGroup: true,
needPagination: true
});
</script>

@ -1,37 +0,0 @@
*{margin: 0; padding: 0;}
body{
font-family: "microsoft yahei";
font-size: 14px;
background-color: #1F1F1F;
}
li{list-style: none;}
a{ text-decoration: none;}
img{ width: 100%;}
#boxhdp{ width: 600px; height: 300px;margin: 0 auto; margin-top: 30px; overflow: hidden; position: relative;}
#img>li{ width: 100%; height: 100%; float: left; text-align: center; display: none;}
#img>.current{display: block;}
#li{position: absolute;
left: 50%;
bottom: 15px;
margin-left: -35px;}
#li>li{ width: 10px;height: 10px; background-color: #ccc; border-radius: 50%; margin-right: 5px; float: left; cursor: pointer;}
#li>.on{ background-color: #f50;}
#an{ display: none;}
#an a{
position: absolute;
top: 50%;
margin-top: -20px;
width: 40px;
height: 40px;
background-color: rgba(0,0,0,.3);
text-align: center;
line-height: 40px;
color: #fff;
font-family: "宋体";
font-weight: 600;
font-size: 1.2em;
}
#an a:hover{
background-color: rgba(0,0,0,.8);
}
#an .an-a2{ right: 0;}

@ -0,0 +1,6 @@
.swiper-item > img{
width: inherit;
height: inherit;
object-fit: cover;
}

@ -1,87 +0,0 @@
//获取idtagName
function getIdName(id,tagName){
if(tagName!=0){
return document.getElementById(id).getElementsByTagName(tagName);
}else{
return document.getElementById(id);
}
}
function hdp(json){
var tiemr=null;
var pd=0;
var index=0;
var that;
var option={
li:"li", //默认值默认用li包裹
boxid:"", //最外面div id
imgid:"", //图片外面id
optid:"", //opt外面id
an:"", //左右按钮id用于移上显示和隐藏
prev:"", //左边箭头id
next:"", //右边箭头id
ms:800 //多少毫秒切换一张,默认800毫秒
}
for(var i in option){
if(json[i]!=undefined){
option[i]=json[i];
}
}
var div=getIdName(option.boxid,0);
var imgs=getIdName(option.imgid,option.li);
var lis=getIdName(option.optid,option.li);
var an=getIdName(option.an,0);
var prev=getIdName(option.prev,0);
var next=getIdName(option.next,0);
var ms=option.ms;
function lbt(that){
if(that>=0){
index=that;
}else{
if(pd==0){
index++;
}else{
index--;
pd=0;
}
}
if(index>=lis.length) index=0;
if(index<0) index=lis.length-1;
for(var j=0;j<lis.length;j++){
lis[j].className="";
imgs[j].className="";
}
lis[index].className="on";
imgs[index].className="current";
}
imgs[index].className="current";
lis[index].className="on";
for(var i=0;i<lis.length;i++){
lis[i].index=i;
lis[i].onclick=function(){
that=this.index;
lbt(that);
}
}
timer=setInterval(lbt,ms);
div.onmouseover=function(){
clearInterval(timer);
an.style.display="block";
}
div.onmouseout=function(){
timer=setInterval(lbt,ms);
an.style.display="none";
}
prev.onclick=function(){
pd=1;
lbt();
}
next.onclick=function(){
pd=0;
lbt();
}
}

@ -0,0 +1,6 @@
/**
* @desc
* @author: Demigodliu
* @date: 2020/06/27 15:16
**/
*{-webkit-tap-highlight-color:rgba(0,0,0,0);transform:translateZ(0)}html,body{margin:0;padding:0}.swiper-container{position:relative;width:800px;min-width:300px;height:300px;min-height:120px;overflow:hidden}.swiper-wrapper{position:absolute;left:0;height:100%}.swiper-wrapper-transition{transition:all .8s ease 0s}.swiper-item{display:inline-block;width:100%;height:100%;float:left}.swiper-btn-group{position:absolute;left:0;top:0;display:flex;justify-content:space-between;align-items:center;width:100%;height:100%}.swiper-btn-group_prev,.swiper-btn-group_next{position:relative;width:50px;height:50px;margin:10px;border-radius:50%;transition:background-color .2s;cursor:pointer}.swiper-btn-group_prev:hover,.swiper-btn-group_next:hover{background-color:rgba(255,255,255,.1)}.swiper-btn-group_prev::before,.swiper-btn-group_next::before{content:"";position:absolute;left:50%;top:50%;transform:translate(-30%,-50%) rotate(45deg);width:15px;height:15px;border-color:#fff;border-style:solid}.swiper-btn-group_prev::before{border-width:0 0 2px 2px}.swiper-btn-group_next::before{border-width:2px 2px 0 0;transform:translate(-70%,-50%) rotate(45deg)}.swiper-pagination{position:absolute;left:0;bottom:5px;display:flex;justify-content:center;align-items:center;width:100%;height:20px}.swiper-pagination-item{width:10px;height:10px;border-radius:50%;background-color:rgba(255,255,255,0.45);transition:all .3s}.swiper-pagination-item:not(:last-child){margin-right:10px}.swiper-pagination-item_active{width:30px;border-radius:5px;background-color:rgba(255,255,255,0.85)}

@ -0,0 +1,6 @@
/**
* @desc 无缝轮播
* @author: Demigodliu
* @date: 2020/06/27 15:15
**/
"use strict";(function(){$.fn.extend({carousel:function a(d){var c=this;d=$.extend($.fn.carousel.defaults,d);d.width=+d.width;d.height=+d.height;d.speed=+d.speed;d.needPrevAndNextBtnGroup=!!d.needPrevAndNextBtnGroup;d.needPagination=!!d.needPagination;var h=d,k=h.width,f=h.height,r=h.speed,j=h.needPrevAndNextBtnGroup,v=h.needPagination;c.css({width:k,height:f});c.find(".swiper-item").css({width:k});var e=null;var m=false;var o={init:function q(){this.cloneItem();this.initBoxAndItem();this.initButtonGroup();this.initPagination()},cloneItem:function s(){var w=c.find(".swiper-item:not(:first-child)").clone().addClass("cloned");var x=c.find(".swiper-item:not(:last-child)").clone().addClass("cloned");c.find(".swiper-wrapper").prepend(w).append(x)},initBoxAndItem:function t(){var z=this;var x=$(".swiper-item");x.not(".cloned").eq(0).addClass("active");var w=$(".active").index();var y=x.length;c.find(".swiper-wrapper").css({"width":y*k,"transform":"translate3d(".concat(-parseInt(w)*k,"px, 0, 0)")});setTimeout(function(){z.transitionToggle(true)},100);o.autoPlay()},initButtonGroup:function u(){if(j){$(".swiper-container").append('\n <div class="swiper-btn-group">\n <div class="swiper-btn-group_prev"></div>\n <div class="swiper-btn-group_next"></div>\n </div>\n ');$(".swiper-btn-group_prev").unbind("click").bind("click",this.prev);$(".swiper-btn-group_next").unbind("click").bind("click",this.next)}},prev:function g(){clearTimeout(m);m=setTimeout(function(){clearInterval(e);var A=o,F=c.find(".swiper-item"),B=F.length,x=c.find(".active"),y=x.index(),E=c.find(".swiper-wrapper"),z=$(".swiper-pagination-item"),D=$(".swiper-pagination-item_active"),w=D.index();var C=(B+2)/3;if(y!==1){x.removeClass("active").prev().addClass("active");E.css("transform","translate3d(-".concat(k*--y,"px, 0px, 0px)"))}else{A.transitionToggle(false);x.removeClass("active");F.not(".cloned").eq(2).addClass("active");var G=c.find(".active").index();E.css("transform","translate3d(-".concat(k*G,"px, 0px, 0px)"));setTimeout(function(){A.transitionToggle(true);A.prev()},100);return false}if(!w){z.removeClass("swiper-pagination-item_active").eq(C-1).addClass("swiper-pagination-item_active")}else{D.removeClass("swiper-pagination-item_active").prev().addClass("swiper-pagination-item_active")}A.autoPlay()},100)},next:function i(){clearTimeout(m);m=setTimeout(function(){clearInterval(e);var A=o,F=c.find(".swiper-item"),B=F.length,x=c.find(".active"),y=x.index(),E=c.find(".swiper-wrapper"),z=$(".swiper-pagination-item"),D=$(".swiper-pagination-item_active"),w=D.index();var C=(B+2)/3;if(y!==B-2){x.removeClass("active").next().addClass("active");E.css("transform","translate3d(-".concat(k*++y,"px, 0px, 0px)"))}else{A.transitionToggle(false);x.removeClass("active");F.not(".cloned").eq(C-3).addClass("active");var G=c.find(".active").index();E.css("transform","translate3d(-".concat(k*G,"px, 0px, 0px)"));setTimeout(function(){A.transitionToggle(true);A.next()},100);return false}if(w!==C-1){D.removeClass("swiper-pagination-item_active").next().addClass("swiper-pagination-item_active")}else{z.removeClass("swiper-pagination-item_active").eq(0).addClass("swiper-pagination-item_active")}A.autoPlay()},100)},initPagination:function b(){if(v){$(".swiper-container").append('<div class="swiper-pagination"></div>');var y=$(".swiper-item").not(".cloned").length;var x="";for(var w=0;w<y;w++){x+='<div class="swiper-pagination-item"></div>'}$(".swiper-pagination").html(x).find(".swiper-pagination-item").eq(0).addClass("swiper-pagination-item_active")}},transitionToggle:function l(w){if(w){c.find(".swiper-wrapper").addClass("swiper-wrapper-transition")}else{c.find(".swiper-wrapper").removeClass("swiper-wrapper-transition")}},autoPlay:function p(){e=setInterval(function(){o.next()},r)},handleSlide:function n(){var B=c.find(".swiper-wrapper");var x=window.navigator.appVersion;var z=0;var A=0;var w=false;var y=0;if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(x)){}else{c.unbind("mousedown").bind("mousedown",function(D){var C=D.clientX;z=C;y=B.css("transform");y=-y.split("-")[1].split(",")[0];w=true}).unbind("mousemove").bind("mousemove",function(F){var D=F.clientX;if(w){clearInterval(e);o.transitionToggle(false);var E=D-z;A=Math.abs(E);var C=y+E;B.css("transform","translate3d(".concat(C,"px, 0px, 0px)"));if(Math.abs(E)>=150){w=false;o.transitionToggle(true);if(E>0){o.prev()}else{o.next()}}}}).unbind("mouseup").bind("mouseup",function(D){var C=D.clientX;w=false;if(A<150){o.transitionToggle(true);B.css("transform","translate3d(".concat(y,"px, 0px, 0px)"));setTimeout(function(){o.autoPlay()},300)}})}}};o.init()}});$.fn.carousel.defaults={width:800,height:300,speed:3000,needPrevAndNextBtnGroup:true,needPagination:true}})();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 139 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 193 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 164 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 169 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 167 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

Loading…
Cancel
Save