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

@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布局,对于数组和对象的理解和运用的更多相关文章
- 每天一个JS 小demo之商品下架特效制作,主要知识点:定时器,倒计时,抖动特效。PS:由于不方便上传文件夹,只能上传效果图,图片等素材需自寻哟。
		<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8" ... 
- vue.js学习之better-scroll封装的轮播图初始化失败
		vue.js学习之better-scroll封装的轮播图初始化失败 问题一:slider组件初始化失败 原因:页面异步获取数据很慢,导致slider初始化之后,数据还未获取到,导致图片还未加载 解决方 ... 
- 【云开发】10分钟零基础学会做一个快递查询微信小程序,快速掌握微信小程序开发技能(轮播图、API请求)
		大家好,我叫小秃僧 这次分享的是10分钟零基础学会做一个快递查询微信小程序,快速掌握开发微信小程序技能. 这篇文章偏基础,特别适合还没有开发过微信小程序的童鞋,一些概念和逻辑我会讲细一点,尽可能用图说 ... 
- 原生JavaScript(js)手把手教你写轮播图插件(banner)
		---恢复内容开始--- 1.轮播图插件 1.什么是插件: 为已有的程序增加功能 2.插件的特点(为什么要做成一个插件)与注意事项: 1.通用性,可移植性强 2.兼容性:不会对其他代码产生影响 3.创 ... 
- Js封装的动画函数实现轮播图
		---恢复内容开始--- 效果图说明:当鼠标移到哪一个按钮上的时候会自动跳转到某一张图片上,并且按钮会以高亮显示 项目目录结构 用到的js封装的animate()动画 function ... 
- 微信小程序_(组件)swiper轮播图
		微信小程序swiper轮播图组件官方文档 传送门 Learn: swiper组件 一.swiper组件 indicator-dots:是否显示面板指示点[默认值false] autoplay:是否自动 ... 
- 原生js用div实现简单的轮播图
		文章地址 https://www.cnblogs.com/sandraryan/ 原生js实现轮播图. 打开页面图片自动轮播,点击prev next按钮切换到上/下一张图片,点击1-5切换到对应图片. ... 
- 微信小程序之 Swiper(轮播图)
		1.逻辑层 mine.js // pages/mine/mine.js Page({ /** * 页面的初始数据 */ data: { /*轮播图 配置*/ imgUrls: [ 'http://im ... 
- 每天一个JS 小demo之个人信息添加。主要知识点:DOM操作中的表格操作,节点操作
		以下是简易效果: <!DOCTYPE html><html lang="en"><head> <meta charset="UT ... 
随机推荐
- Java排序算法之希尔(Shell)排序
			基本思想: 希尔排序就是对直接插入排序的一个优化.现在有一个array,希尔排序就是设定一个增量incrementNum(0<incrementNum<array.length).先从ar ... 
- ajax发送异步请求
			一:得到XMLHttpRequest对象 ajax其实只需要学习XMLHttpRequest一个对象 大多数浏览器都支持: var xmlHttp = new XMLHttprequest(); IE ... 
- Linux-进程描述(4)之进程优先级与进程创建执行
			进程优先级 进程cpu资源分配就是指进程的优先权(priority).优先权高的进程有优先执行权利. 权限与优先级.权限(privilege)是指在多用户计算机系统的管理中,某个特定的用户具有特定的系 ... 
- python基本数据类型——list
			一.创建列表: li = [] li = list() name_list = ['alex', 'seven', 'eric'] name_list = list(['alex', 'seven', ... 
- CSS表单属性
			一般来说,表单在一个页面中是必不可少的,下面是我对表单的知识总结: 依次要说的是表单元素.表单属性.以及表单提交(js知识) 1,表单元素: <form action="提交的位置 / ... 
- C语言学习第八章
			今天开始学习字符串,学完以后最低要做到了解什么是字符串,以及字符串的一些应用方法,毕竟字符串还是很常见的. 简单的字符串"helloworld",这个字符串大家应该都很眼熟,学编程 ... 
- lock invoke 死锁事例
			代码如下: using System; using System.Collections.Generic; using System.Windows.Forms; using System.Threa ... 
- java:Comparator比较器
			/*Comparator是java.util包里的一个接口,使用时应该实现导入相应的包, *再写一个实现了Comparator接口的类,并复写int compare(Object o)方法, *写出你 ... 
- luogu 1521-求逆序对
			题意: 逆序对指在一个序列中ai>aj && i < j,也就是一前一后两个数,当大的在前面的时候即算一对. 题目求在一个由1-n组成的序列中逆序对为k的序列的个数. 出题 ... 
- JavaScript常用的方法和函数(setAttribute和getAttribute )
			仅记录学习的新知识和示例,无干货. 1.setAttribute和getAttribute (Attribute:属性) setAttribute:为元素添加指定的属性,并为其赋值: ... 
