支持移动端的纯js轮播图
JavaScript Code
- function main() {
- var imagesCommon = ["./assets/1.png", "./assets/2.png", "./assets/3.png"];
- var root = document.getElementById("root");
- function appendContainer(text) {
- var container = document.createElement("div");
- container.className = "container";
- root.appendChild(container);
- if (text) {
- var introduce = document.createElement("div");
- introduce.className = "introduce";
- var textNode = document.createTextNode(text);
- introduce.appendChild(textNode);
- container.appendChild(introduce);
- }
- return container;
- }
原文地址:http://www.freejs.net/article_jiaodiantu_809.html