<template>
<div>
<div class="back_add">
<div class="threeImg">
<div class="Containt">
<div class="iconleft" @click="zuohua">
<i class="el-icon-arrow-left"></i>
</div>
<ul :style="{'left':calleft + 'px'}" v-on:mouseover="stopmove()" v-on:mouseout="move()">
<li v-for="(item,index) in superurl" :key="index">
<img :src="item.img">
</li>
</ul>
<div class="iconright" @click="youhua">
<i class="el-icon-arrow-right"></i>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: "HelloWorld",
data() {
return {
superurl: [
{
url: "",
img:
"https://img.mukewang.com/szimg/5ac2dfe100014a9005400300-360-202.jpg"
},
{
url: "",
img:
"https://img.mukewang.com/szimg/5c62a4dc0812e84106000338-360-202.jpg"
},
{
url: "",
img:
"https://img.mukewang.com/szimg/5c7c82630820acf806000338-360-202.jpg"
},
{
url: "",
img:
"https://img.mukewang.com/szimg/5c7e6835087ef3d806000338-360-202.jpg"
},
{
url: "",
img:
"https://img.mukewang.com/szimg/59b8a486000107fb05400300-360-202.jpg"
},
{
url: "",
img:
"https://img.mukewang.com/szimg/5c7516fa081aab2b06000338-360-202.jpg"
}
],
calleft: 0
};
},
created() {
this.move();
},
methods: {
//移动
move() {
this.timer = setInterval(this.starmove, 5000);
},
//开始移动
starmove() {
this.calleft -= 340;
if (this.calleft < -1200) {
this.calleft = 0;
}
},
//鼠标悬停时停止移动
stopmove() {
clearInterval(this.timer);
},
//点击按钮左移
zuohua() {
this.calleft -= 340;
if (this.calleft < -1200) {
this.calleft = 0;
}
},
//点击按钮右移
youhua() {
this.calleft += 340;
if (this.calleft > 0) {
this.calleft = -1020;
}
}
}
};
</script> <style scoped>
/*超链接图片*/ #divAdd {
background-color: #ededed;
/*width: 100%;*/
/*min-width: 1200px;*/
width: 1000px;
margin: 0px auto;
} .divAdd-con {
margin: 0px auto;
width: 1000px;
overflow: auto;
padding: 30px 0px;
} .divAdd-con img {
float: left;
} .indexrt {
margin: 0px 40px;
} .divAddleft img {
float: left;
margin-bottom: 7px;
} .divAddleft {
float: left;
display: inline;
width: 370px;
} .divAddrt {
float: right;
display: inline;
margin-top: 7px;
} .back_add {
background-color: #ededed;
} .divAdd-con img {
border: none;
} a:focus,
a:hover {
color: #23527c;
} .threeImg {
height: 158px;
background: #ededed;
border-bottom: 3px solid #4679b2;
min-width: 1000px;
} .threeImg .Containt ul {
margin: 0 auto;
width: 2400px;
position: absolute;
left: 0px;
cursor: pointer;
height: 100%;
} .threeImg .Containt ul li {
width: 300px;
margin-right: 40px;
margin-top: 10px;
float: left;
} .threeImg .Containt ul li img {
height: 128px;
width: 100%;
} .Containt {
position: relative;
width: 1000px;
height: 130px;
overflow: hidden;
margin: 0 auto;
} .iconleft {
position: absolute;
width: 20px;
height: 80px;
top: 10px;
z-index: 99999;
padding-top: 48px;
background-color: #ddd;
vertical-align: middle;
} .iconright {
position: relative;
left: 978px;
top: 70px;
background-color: #ddd;
/*position: absolute;*/
width: 20px;
height: 80px;
top: 10px;
z-index: 99999;
padding-top: 48px;
background-color: #ddd;
vertical-align: middle;
}
</style>

vue手把手教你实现走马灯商品左右轮播图的更多相关文章

  1. vue项目中,使用vue-awesome-swiper插件实现轮播图

    一.安装 npm install vue-awesome-swiper 二.项目中引入 import 'swiper/dist/css/swiper.css'import {swiper,swiper ...

  2. 设置头像、商品、轮播图为背景图时需要的css

    background-repeat: no-repeat;background-size: cover;background-position: center center;

  3. iOS回顾笔记(05) -- 手把手教你封装一个广告轮播图框架

    html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,bi ...

  4. 七、Vue组件库:Element、Swiper(轮播专用组件)

    一.vue的Element组件库 官网:https://element.eleme.cn/#/zh-CN 1.1安装 推荐安装方法: 首先要进入项目目录 cnpm i element-ui -S 或 ...

  5. 带轮播图、导航栏、商品的简单html,以及轮播图下边数字随轮播图的改变而改变

    ---恢复内容开始--- 在做这个的时候,最不会的是中间轮播图下边的数字是如何实现转变的,后来加入了jQuery就能实现了. css部分: <style type="text/css& ...

  6. vue轮播图插件vue-awesome-swiper的使用与组件化

    不管是APP还是移动端网页开发,轮播图在大部分项目当中都是存在的,这时候如果用vue开发项目,选择一款好的插件并且封装好是很重要的 1. 推荐使用vue-awesome-swiper 安装:cnpm ...

  7. vue music-抓取歌单列表数据(渲染轮播图)

    下载安装新依赖 babel-runtime:对es6语法进行转译 fastclick:对移动端进行点击300毫秒延迟 ,,取消掉 babel-polyfill:API 先添加,在npm install ...

  8. vue轮播图

    vue开发中遇到这样一个需求实现导航栏和中间内容相结合实现页面滑动导航跟随改变的效果.看效果: 这里我用的是vue所带的插件:vue-awesome-swiper,传送门:https://www.np ...

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

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

随机推荐

  1. JavaScript字符串字节长度

    var txt2="He中!!";var t = txt2.replace(/[^\u0000-\u00ff]/g,"aa").length;//值是7

  2. C#发送内置图片的html格式邮件的代码

    将写内容过程经常用的内容段备份一次,下面的内容是关于C#发送内置图片的html格式邮件的内容,应该对码农们也有用处.MailMessage m = new MailMessage();m.Subjec ...

  3. CAN双机通讯调试小结(SJA1000与MCP2515通讯)

    2011-12-07 21:36:02. 效果图: 1,51的SJA1000自收自发测试完成,见上一篇小结. 2,SJA1000自测完成后,再自测MCP2515就非常容易.主要是设置工作模式为回环模式 ...

  4. ASP.NET 教程汇总

    channel9 https://channel9.msdn.com/ .net core项目实战 https://study.163.com/course/introduction.htm?cour ...

  5. kubernetes(k8s) helm安装kafka、zookeeper

    通过helm在k8s上部署kafka.zookeeper 通过helm方法安装 k8s上安装kafka,可以使用helm,将kafka作为一个应用安装.当然这首先要你的k8s支持使用helm安装.he ...

  6. Bugku-CTF之never give up

    Day23 never give up http://123.206.87.240:8006/test/hello.php   本题要点:url编码,base64编码,代码审计,php函数       ...

  7. UIPresentationController - iOS自定义模态弹出框

    参考: https://developer.apple.com/library/archive/featuredarticles/ViewControllerPGforiPhoneOS/Definin ...

  8. 【Django基本命令002】

    在mac或者window的终端直接输入这些命令(不是Python的shell中) 一.创建Django项目之前必须先激活 具体方法可以参考Python机器语言学习博客 二.开始新建项目 1.新建一个d ...

  9. Android中的广播基本实现及回调方法的理解

    在Android中broadcast这一节的内容其实不算多主要是牵扯到一个broadcastreceiver类,这个类是一个抽象类,下面有一个抽象方法onreceiver(),可以再我们收到网络状态变 ...

  10. (Code) Python implementation of phrase extraction from sentence

    import os import numpy as np import pandas as pd from tqdm import tqdm import numpy as np import str ...