@charset "utf-8";
/* CSS Document */ * { padding:; margin:; }
li { list-style: none; }
img { border: none; }
body { background: #ececec; padding-top: 50px; } #automatic { width: 970px; height: 344px; position: relative; margin: 0 auto; overflow: hidden; } .prev_div { width: 130px; height: 72px; position: absolute; top: 128px; left: 92px; z-index:; background: red; filter: alpha(opacity=0); opacity:; cursor: pointer; }
.next_div { width: 130px; height: 72px; position: absolute; top: 128px; right: 92px; z-index:; background: red; filter: alpha(opacity=0); opacity:; cursor: pointer; } #automatic .prev { width: 120px; height: 72px; position: absolute; top: 108px; left: 72px; z-index:; }
#automatic .prev .ico { width: 76px; height: 112px; position: absolute; top:; left:; background: url(images/prev.png); }
#automatic .prev .ico1 { width: 76px; height: 112px; position: absolute; top:; left:; background: url(images/prev_1.png); z-index:; filter: alpha(opacity=0); opacity:; }
#automatic .prev .txt { width: 106px; height: 112px; position: absolute; top:; left: 65px; background: url(images/prev_txt.png) no-repeat; filter: alpha(opacity=0); opacity:; } #automatic .next { width: 120px; height: 72px; position: absolute; top: 108px; right: 72px; z-index:; }
#automatic .next .ico { width: 76px; height: 112px; position: absolute; top:; right:; background: url(images/next.png) no-repeat; }
#automatic .next .ico1 { width: 76px; height: 112px; position: absolute; top:; right: 0px; background: url(images/next_1.png) no-repeat; z-index:; filter: alpha(opacity=0); opacity:; }
#automatic .next .txt { width: 106px; height: 112px; position: absolute; top:; right: 65px; background: url(images/next_txt.png) no-repeat; filter: alpha(opacity=0); opacity:; } #automatic ul { width: 970px; height: 344px; position: absolute; top:; left:; z-index:; }
#automatic li { position: absolute; } #automatic .line { border: 4px solid #fff; width: 672px; height: 336px; position: absolute; top:; left: 50%; margin-left: -340px; z-index:; } #automatic .pos_0 { top: -104px; left:; z-index:; filter: alpha(opacity=0); opacity:; }
#automatic .pos_1 { top: 104px; left:; z-index:; filter: alpha(opacity=60); opacity: 0.6; }
#automatic .pos_2 { top: 43px; left: 50px; z-index:; filter: alpha(opacity=80); opacity: 0.8; }
#automatic .pos_3 { top:; left: 145px; z-index:; }
#automatic .pos_4 { top: 43px; right: 50px; z-index:; filter: alpha(opacity=80); opacity: 0.8; }
#automatic .pos_5 { top: 104px; right:; z-index:; filter: alpha(opacity=60); opacity: 0.6; }
#automatic .pos_6 { top: -104px; right:; z-index:; filter: alpha(opacity=0); opacity:; } #footer { width: 970px; height: 30px; text-align: center; padding-top: 50px; margin: 0 auto; }
#footer a { color: #930; font-family: arial; font-size: 15px; text-decoration: none; border-bottom: 1px dotted #930; }
#footer a:hover { border-bottom: 1px solid #930; }
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>韩雪冬网站效果 - 妙味课堂 - www.miaov.com</title>
<!--[if lte IE 6]>
<script src="js/DD_belatedPNG_0.0.8a.js" type="text/javascript"></script>
<script type="text/javascript">
DD_belatedPNG.fix('span');
</script>
<![endif]-->
<link href="style.css" rel="stylesheet" type="text/css" />
</head> <body> <div id="automatic"> <div class="prev_div"></div>
<a class="prev" href="###">
<span class="ico1"></span>
<span class="ico"></span>
<span class="txt"></span>
</a> <div class="next_div"></div>
<a class="next" href="###">
<span class="ico1"></span>
<span class="ico"></span>
<span class="txt"></span>
</a> <div class="line"></div> <ul class="picList">
<li class="pos_0"><a href="http://www.miaov.com"><img src="data:images/8.jpg" width="100" alt="妙味课堂 www.miaov.com" longdesc="http://www.miaov.com" /></a></li>
<li class="pos_1"><a href="http://www.miaov.com"><img src="data:images/1.jpg" width="270" alt="妙味课堂 www.miaov.com" longdesc="http://www.miaov.com" /></a></li>
<li class="pos_2"><a href="http://www.miaov.com"><img src="data:images/2.jpg" width="510" alt="妙味课堂 www.miaov.com" longdesc="http://www.miaov.com" /></a></li>
<li class="pos_3"><a href="http://www.miaov.com"><img src="data:images/3.jpg" width="680" alt="妙味课堂 www.miaov.com" longdesc="http://www.miaov.com" /></a></li>
<li class="pos_4"><a href="http://www.miaov.com"><img src="data:images/4.jpg" width="510" alt="妙味课堂 www.miaov.com" longdesc="http://www.miaov.com" /></a></li>
<li class="pos_5"><a href="http://www.miaov.com"><img src="data:images/5.jpg" width="270" alt="妙味课堂 www.miaov.com" longdesc="http://www.miaov.com" /></a></li>
<li class="pos_6"><a href="http://www.miaov.com"><img src="data:images/6.jpg" width="270" alt="妙味课堂 www.miaov.com" longdesc="http://www.miaov.com" /></a></li>
<li class="pos_6"><a href="http://www.miaov.com"><img src="data:images/7.jpg" width="270" alt="妙味课堂 www.miaov.com" longdesc="http://www.miaov.com" /></a></li>
</ul>
</div>
<p id="footer"><a href="http://www.miaov.com">妙味课堂 - www.miaov.com</a></p>
</body>
</html>
<script type="text/javascript" src="../../startmove.js"></script>
<script type="text/javascript">
/*初始宽度*/
// 使用函数自执行写法,防止全局污染
(function(){
var picList = document.querySelectorAll('.picList>li');
for(var i = 0; i <picList.length;i++){
// 为什么要加个[0]?
var img = picList[i].getElementsByTagName("img")[0];
css(picList[i],"width",img.width);
img.style.width = "100%";
}
})();
/* 左侧按钮的鼠标移入移出动画 */
(function(){
// 由于prev内部的元素层级都比它自身高,盖在它上面,所以如果在prev上加onmouseover或者onmouseout,实际上鼠标根本移动不到prev上,所以添加一个层级较高的prevBtn来防止干扰,nextBtn同理
var prevBtn = document.querySelector('.prev_div');
var prev = document.querySelector('.prev');
var prevSpan = prev.querySelectorAll('span');
prevBtn.onmouseover = function(){
startMove({
el: prevSpan[1],
target: {
left: 12
},
time: 300,
type: "easeBoth"
});
startMove({
el: prevSpan[0],
target: {
opacity:1,
left: 12
},
time: 300,
type: "easeBoth"
});
startMove({
el: prevSpan[2],
target: {
opacity:1,
left: 53
},
time: 300,
type: "easeBoth"
});
};
prevBtn.onmouseout = function(){
startMove({
el: prevSpan[1],
target: {
left: 0
},
time: 300,
type: "easeBoth"
});
startMove({
el: prevSpan[0],
target: {
opacity:0,
left: 0
},
time: 300,
type: "easeBoth"
});
startMove({
el: prevSpan[2],
target: {
opacity:0,
left: 65
},
time: 300,
type: "easeBoth"
});
};
})();
/* 右侧按钮的鼠标移入移出动画 */
(function(){
var nextBtn = document.querySelector('.next_div');
var next = document.querySelector('.next');
var nextSpan = next.querySelectorAll('span');
nextBtn.onmouseover = function(){
startMove({
el: nextSpan[1],
target: {
right: 12
},
time: 300,
type: "easeBoth"
});
startMove({
el: nextSpan[0],
target: {
opacity:1,
right: 12
},
time: 300,
type: "easeBoth"
});
startMove({
el: nextSpan[2],
target: {
opacity:1,
right: 53
},
time: 300,
type: "easeBoth"
});
};
nextBtn.onmouseout = function(){
startMove({
el: nextSpan[1],
target: {
right: 0
},
time: 300,
type: "easeBoth"
});
startMove({
el: nextSpan[0],
target: {
opacity:0,
right: 0
},
time: 300,
type: "easeBoth"
});
startMove({
el: nextSpan[2],
target: {
opacity:0,
right: 65
},
time: 300,
type: "easeBoth"
});
};
})();
/*
点击切换动画
*/
(function(){
var wrap = document.querySelector('#automatic');
var prevBtn = document.querySelector('.prev_div');
var nextBtn = document.querySelector('.next_div');
var picList = document.querySelectorAll('.picList>li');
var line = document.querySelector('.line');
var attrs = [];
var timer = 0;
for(var i = 0; i <picList.length; i++){
// 先给li在数组中对应的空间内添加一个对象,用于存储它的各项属性数据
attrs[i] = {};
attrs[i].width = css(picList[i],"width");
attrs[i].left = css(picList[i],"left");
attrs[i].top = css(picList[i],"top");
attrs[i].opacity = css(picList[i],"opacity");
attrs[i].zIndex = css(picList[i],"zIndex");
}
prevBtn.onclick = function(){
attrs.push(attrs.shift());
setStyle();
};
nextBtn.onclick = function(){
attrs.unshift(attrs.pop());
setStyle();
};
function setStyle(){
css(line,"opacity",0);
for(var i = 0; i <picList.length; i++){
// css(picList[i],"left",attrs[i].left);
// css(picList[i],"top",attrs[i].top);
// css(picList[i],"opacity",attrs[i].opacity);
// css(picList[i],"zIndex",attrs[i].zIndex);
// 让图片提前显示出来再变化样式
css(picList[i],"zIndex",attrs[i].zIndex);
startMove({
el: picList[i],
target: attrs[i],
time: 500,
type: "easeOut",
callBack: function(){
startMove({
el:line,
target:{opacity:1},
time: 200,
type: "easeOut",
callBack:function(){
console.log(1);
}
});
}
});
}
}
timer = setInterval(function(){
nextBtn.onclick();
},3000);
wrap.onmouseover = function(){
clearInterval(timer);
}
wrap.onmouseout = function(){
timer = setInterval(function(){
nextBtn.onclick();
},3000);
}
})();
</script>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>韩雪冬网站效果 - 妙味课堂 - www.miaov.com</title>
<!--[if lte IE 6]>
<script src="js/DD_belatedPNG_0.0.8a.js" type="text/javascript"></script>
<script type="text/javascript">
DD_belatedPNG.fix('span');
</script>
<![endif]-->
<link href="style.css" rel="stylesheet" type="text/css" />
</head>

<body>

<div id="automatic">

<div class="prev_div"></div>
<a class="prev" href="###">
<span class="ico1"></span>
<span class="ico"></span>
<span class="txt"></span>
</a>

<div class="next_div"></div>
<a class="next" href="###">
<span class="ico1"></span>
<span class="ico"></span>
<span class="txt"></span>
</a>

<div class="line"></div>

<ul class="picList">
<li class="pos_0"><a href="http://www.miaov.com"><img src="data:images/8.jpg" width="100" alt="妙味课堂 www.miaov.com" longdesc="http://www.miaov.com" /></a></li>
<li class="pos_1"><a href="http://www.miaov.com"><img src="data:images/1.jpg" width="270" alt="妙味课堂 www.miaov.com" longdesc="http://www.miaov.com" /></a></li>
<li class="pos_2"><a href="http://www.miaov.com"><img src="data:images/2.jpg" width="510" alt="妙味课堂 www.miaov.com" longdesc="http://www.miaov.com" /></a></li>
<li class="pos_3"><a href="http://www.miaov.com"><img src="data:images/3.jpg" width="680" alt="妙味课堂 www.miaov.com" longdesc="http://www.miaov.com" /></a></li>
<li class="pos_4"><a href="http://www.miaov.com"><img src="data:images/4.jpg" width="510" alt="妙味课堂 www.miaov.com" longdesc="http://www.miaov.com" /></a></li>
<li class="pos_5"><a href="http://www.miaov.com"><img src="data:images/5.jpg" width="270" alt="妙味课堂 www.miaov.com" longdesc="http://www.miaov.com" /></a></li>
<li class="pos_6"><a href="http://www.miaov.com"><img src="data:images/6.jpg" width="270" alt="妙味课堂 www.miaov.com" longdesc="http://www.miaov.com" /></a></li>
<li class="pos_6"><a href="http://www.miaov.com"><img src="data:images/7.jpg" width="270" alt="妙味课堂 www.miaov.com" longdesc="http://www.miaov.com" /></a></li>
</ul>
</div>
<p id="footer"><a href="http://www.miaov.com">妙味课堂 - www.miaov.com</a></p>
</body>
</html>
<script type="text/javascript" src="../../startmove.js"></script>
<script type="text/javascript">
/*初始宽度*/
// 使用函数自执行写法,防止全局污染
(function(){
var picList = document.querySelectorAll('.picList>li');
for(var i = 0; i <picList.length;i++){
// 为什么要加个[0]?
var img = picList[i].getElementsByTagName("img")[0];
css(picList[i],"width",img.width);
img.style.width = "100%";
}
})();
/* 左侧按钮的鼠标移入移出动画 */
(function(){
// 由于prev内部的元素层级都比它自身高,盖在它上面,所以如果在prev上加onmouseover或者onmouseout,实际上鼠标根本移动不到prev上,所以添加一个层级较高的prevBtn来防止干扰,nextBtn同理
var prevBtn = document.querySelector('.prev_div');
var prev = document.querySelector('.prev');
var prevSpan = prev.querySelectorAll('span');
prevBtn.onmouseover = function(){
startMove({
el: prevSpan[1],
target: {
left: 12
},
time: 300,
type: "easeBoth"
});
startMove({
el: prevSpan[0],
target: {
opacity:1,
left: 12
},
time: 300,
type: "easeBoth"
});
startMove({
el: prevSpan[2],
target: {
opacity:1,
left: 53
},
time: 300,
type: "easeBoth"
});
};
prevBtn.onmouseout = function(){
startMove({
el: prevSpan[1],
target: {
left: 0
},
time: 300,
type: "easeBoth"
});
startMove({
el: prevSpan[0],
target: {
opacity:0,
left: 0
},
time: 300,
type: "easeBoth"
});
startMove({
el: prevSpan[2],
target: {
opacity:0,
left: 65
},
time: 300,
type: "easeBoth"
});
};
})();
/* 右侧按钮的鼠标移入移出动画 */
(function(){
var nextBtn = document.querySelector('.next_div');
var next = document.querySelector('.next');
var nextSpan = next.querySelectorAll('span');
nextBtn.onmouseover = function(){
startMove({
el: nextSpan[1],
target: {
right: 12
},
time: 300,
type: "easeBoth"
});
startMove({
el: nextSpan[0],
target: {
opacity:1,
right: 12
},
time: 300,
type: "easeBoth"
});
startMove({
el: nextSpan[2],
target: {
opacity:1,
right: 53
},
time: 300,
type: "easeBoth"
});
};
nextBtn.onmouseout = function(){
startMove({
el: nextSpan[1],
target: {
right: 0
},
time: 300,
type: "easeBoth"
});
startMove({
el: nextSpan[0],
target: {
opacity:0,
right: 0
},
time: 300,
type: "easeBoth"
});
startMove({
el: nextSpan[2],
target: {
opacity:0,
right: 65
},
time: 300,
type: "easeBoth"
});
};
})();
/*
点击切换动画
*/
(function(){
var wrap = document.querySelector('#automatic');
var prevBtn = document.querySelector('.prev_div');
var nextBtn = document.querySelector('.next_div');
var picList = document.querySelectorAll('.picList>li');
var line = document.querySelector('.line');
var attrs = [];
var timer = 0;
for(var i = 0; i <picList.length; i++){
// 先给li在数组中对应的空间内添加一个对象,用于存储它的各项属性数据
attrs[i] = {};
attrs[i].width = css(picList[i],"width");
attrs[i].left = css(picList[i],"left");
attrs[i].top = css(picList[i],"top");
attrs[i].opacity = css(picList[i],"opacity");
attrs[i].zIndex = css(picList[i],"zIndex");
}
prevBtn.onclick = function(){
attrs.push(attrs.shift());
setStyle();
};
nextBtn.onclick = function(){
attrs.unshift(attrs.pop());
setStyle();
};
function setStyle(){
css(line,"opacity",0);
for(var i = 0; i <picList.length; i++){
// css(picList[i],"left",attrs[i].left);
// css(picList[i],"top",attrs[i].top);
// css(picList[i],"opacity",attrs[i].opacity);
// css(picList[i],"zIndex",attrs[i].zIndex);
// 让图片提前显示出来再变化样式
css(picList[i],"zIndex",attrs[i].zIndex);
startMove({
el: picList[i],
target: attrs[i],
time: 500,
type: "easeOut",
callBack: function(){
startMove({
el:line,
target:{opacity:1},
time: 200,
type: "easeOut",
callBack:function(){
console.log(1);
}
});
}
});
}
}
timer = setInterval(function(){
nextBtn.onclick();
},3000);
wrap.onmouseover = function(){
clearInterval(timer);
}
wrap.onmouseout = function(){
timer = setInterval(function(){
nextBtn.onclick();
},3000);
}
})();
</script>

//动画形式公式
var Tween = {
linear: function (t, b, c, d){
return c*t/d + b;
},
easeIn: function(t, b, c, d){
return c*(t/=d)*t + b;
},
easeOut: function(t, b, c, d){
return -c *(t/=d)*(t-2) + b;
},
easeBoth: function(t, b, c, d){
if ((t/=d/2) < 1) {
return c/2*t*t + b;
}
return -c/2 * ((--t)*(t-2) - 1) + b;
},
easeInStrong: function(t, b, c, d){
return c*(t/=d)*t*t*t + b;
},
easeOutStrong: function(t, b, c, d){
return -c * ((t=t/d-1)*t*t*t - 1) + b;
},
easeBothStrong: function(t, b, c, d){
if ((t/=d/2) < 1) {
return c/2*t*t*t*t + b;
}
return -c/2 * ((t-=2)*t*t*t - 2) + b;
},
elasticIn: function(t, b, c, d, a, p){
if (t === 0) {
return b;
}
if ( (t /= d) == 1 ) {
return b+c;
}
if (!p) {
p=d*0.3;
}
if (!a || a < Math.abs(c)) {
a = c;
var s = p/4;
} else {
var s = p/(2*Math.PI) * Math.asin (c/a);
}
return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
},
elasticOut: function(t, b, c, d, a, p){
if (t === 0) {
return b;
}
if ( (t /= d) == 1 ) {
return b+c;
}
if (!p) {
p=d*0.3;
}
if (!a || a < Math.abs(c)) {
a = c;
var s = p / 4;
} else {
var s = p/(2*Math.PI) * Math.asin (c/a);
}
return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
},
elasticBoth: function(t, b, c, d, a, p){
if (t === 0) {
return b;
}
if ( (t /= d/2) == 2 ) {
return b+c;
}
if (!p) {
p = d*(0.3*1.5);
}
if ( !a || a < Math.abs(c) ) {
a = c;
var s = p/4;
}
else {
var s = p/(2*Math.PI) * Math.asin (c/a);
}
if (t < 1) {
return - 0.5*(a*Math.pow(2,10*(t-=1)) *
Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
}
return a*Math.pow(2,-10*(t-=1)) *
Math.sin( (t*d-s)*(2*Math.PI)/p )*0.5 + c + b;
},
backIn: function(t, b, c, d, s){
if (typeof s == 'undefined') {
s = 1.70158;
}
return c*(t/=d)*t*((s+1)*t - s) + b;
},
backOut: function(t, b, c, d, s){
if (typeof s == 'undefined') {
s = 2.70158; //回缩的距离
}
return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
},
backBoth: function(t, b, c, d, s){
if (typeof s == 'undefined') {
s = 1.70158;
}
if ((t /= d/2 ) < 1) {
return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
}
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
},
bounceIn: function(t, b, c, d){
return c - Tween['bounceOut'](d-t, 0, c, d) + b;
},
bounceOut: function(t, b, c, d){
if ((t/=d) < (1/2.75)) {
return c*(7.5625*t*t) + b;
} else if (t < (2/2.75)) {
return c*(7.5625*(t-=(1.5/2.75))*t + 0.75) + b;
} else if (t < (2.5/2.75)) {
return c*(7.5625*(t-=(2.25/2.75))*t + 0.9375) + b;
}
return c*(7.5625*(t-=(2.625/2.75))*t + 0.984375) + b;
},
bounceBoth: function(t, b, c, d){
if (t < d/2) {
return Tween['bounceIn'](t*2, 0, c, d) * 0.5 + b;
}
return Tween['bounceOut'](t*2-d, 0, c, d) * 0.5 + c*0.5 + b;
}
}
// 获取或者设置样式
function css(el,attr,val){
if(arguments.length == 2){
if(el.currentStyle){
val = el.currentStyle[attr];
} else {
val = getComputedStyle(el)[attr];
}
return parseFloat(val);
} else {
if(attr == "opacity"){
el.style.opacity = val;
el.style.filter = "alpha(opacity= "+val*100+")";
} else {
el.style[attr] = val + "px";
}
}
}
//执行动画
function startMove(init){
clearInterval(init.el.timer);
var t = 0;
var b = {};
var c = {};
var d = init.time/20;
for( var s in init.target){
b[s] = css(init.el,s);
c[s] = init.target[s] - b[s];
}
init.el.timer = setInterval(function(){
t++;
if(t > d){
clearInterval(init.el.timer);
init.callBack&&init.callBack();
} else {
for(var s in init.target){
var val = Tween[init.type](t,b[s],c[s],d);
css(init.el,s,val);
}
}
},20);
}

每天一个JS 小demo之韩雪冬轮播图。主要知识点:html,css布局,对于数组和对象的理解和运用的更多相关文章

  1. 每天一个JS 小demo之商品下架特效制作,主要知识点:定时器,倒计时,抖动特效。PS:由于不方便上传文件夹,只能上传效果图,图片等素材需自寻哟。

    <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8" ...

  2. vue.js学习之better-scroll封装的轮播图初始化失败

    vue.js学习之better-scroll封装的轮播图初始化失败 问题一:slider组件初始化失败 原因:页面异步获取数据很慢,导致slider初始化之后,数据还未获取到,导致图片还未加载 解决方 ...

  3. 【云开发】10分钟零基础学会做一个快递查询微信小程序,快速掌握微信小程序开发技能(轮播图、API请求)

    大家好,我叫小秃僧 这次分享的是10分钟零基础学会做一个快递查询微信小程序,快速掌握开发微信小程序技能. 这篇文章偏基础,特别适合还没有开发过微信小程序的童鞋,一些概念和逻辑我会讲细一点,尽可能用图说 ...

  4. 原生JavaScript(js)手把手教你写轮播图插件(banner)

    ---恢复内容开始--- 1.轮播图插件 1.什么是插件: 为已有的程序增加功能 2.插件的特点(为什么要做成一个插件)与注意事项: 1.通用性,可移植性强 2.兼容性:不会对其他代码产生影响 3.创 ...

  5. Js封装的动画函数实现轮播图

    ---恢复内容开始--- 效果图说明:当鼠标移到哪一个按钮上的时候会自动跳转到某一张图片上,并且按钮会以高亮显示 项目目录结构 用到的js封装的animate()动画         function ...

  6. 微信小程序_(组件)swiper轮播图

    微信小程序swiper轮播图组件官方文档 传送门 Learn: swiper组件 一.swiper组件 indicator-dots:是否显示面板指示点[默认值false] autoplay:是否自动 ...

  7. 原生js用div实现简单的轮播图

    文章地址 https://www.cnblogs.com/sandraryan/ 原生js实现轮播图. 打开页面图片自动轮播,点击prev next按钮切换到上/下一张图片,点击1-5切换到对应图片. ...

  8. 微信小程序之 Swiper(轮播图)

    1.逻辑层 mine.js // pages/mine/mine.js Page({ /** * 页面的初始数据 */ data: { /*轮播图 配置*/ imgUrls: [ 'http://im ...

  9. 每天一个JS 小demo之个人信息添加。主要知识点:DOM操作中的表格操作,节点操作

    以下是简易效果: <!DOCTYPE html><html lang="en"><head> <meta charset="UT ...

随机推荐

  1. 如何有效快速提高Java服务端开发人员的技术水平?

    我相信很多工作了3-5年的开发人员都会经常问自己几个问题: 1.为什么总是感觉技术没有质的提高? 2.如何能够有效和快速的提高自身的技术水平? 3.如何进入到一个牛逼的大公司,认识牛逼的人? 这篇文章 ...

  2. linux 基础(1)

    第一章 Linux 基础知识(一) 一.硬件介绍: 由一条总线把CPU.内存和I/O设备串联起来并与其他设备进行通信.CPU负责运算,内存用于储存临时变量,硬盘用于储存数据.1.1处理器CPU 从内存 ...

  3. DirectFB、Layer、Window、Surface之间关系

    层(Layers) 表示一块儿独立的图像缓冲区.大多数的嵌入式设备都有多个层.他们由硬件使用合适的alpha值来blending,然后显示. 表面 (Surface) 用来保存像素数据的保留内存区域. ...

  4. register_sysctl_table实现内核数据交互

    作者:Younger Liu, 本作品采用知识共享署名-非商业性使用-相同方式共享 3.0 未本地化版本许可协议进行许可. Sysctl是一种用户应用来设置和获得运行时内核的配置参数的一种有效方式,通 ...

  5. 使用Spigot搭建MineCraft服务器

    MineCraft 这种游戏还是人多了好玩,以前的服务器放在同学的Windows电脑上,每次我们想玩的时候就让让去打开,但是总是有一些原因,想玩的时候服务器没开着,不想玩的时候服务器空开着费电.昨天一 ...

  6. 搭建本地git仓库

    使用工具:git|码云 步骤: 注册码云账号,创建项目名称等. 本地git配置 本地文件目录:git init(初始化创建分支master) 基础配置:git config --global user ...

  7. jdbc连接数据库工具包模板

    jdbc连接数据库操作 jdbc连接数据库模板,收藏可做模板使用(小型工程,一般大工程都会用框架,c3p0等连接,不考虑此种方法!). 配置文件的使用(使用配置文件可以使我们后期的修改更加方便,当然, ...

  8. Android自定义评分控件:RatingStarView

    RatingStarView Android自定义的评分控件,类似ProgressBar那样的,使用星星图标(full.half.empty)作为progress标识的评分/打分控件. 效果图 图1: ...

  9. 小谈ThinkPHP

    ThinkPHP也是一个MVC框架,分视图.控制器和模型,和Yii框架相比相对较好理解,并且是轻量级的框架(相对于Yii来说),在使用Yii框架时候如果将框架放在项目文件中,用编辑器打开文件都比较慢, ...

  10. 利用Java提供的Observer接口和Observable类实现观察者模式

    对于观察者模式,其实Java已经为我们提供了已有的接口和类.对于订阅者(Subscribe,观察者)Java为我们提供了一个接口,JDK源码如下: package java.util; public ...