最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

基于vue.js實(shí)現(xiàn)圖片輪播效果

 更新時(shí)間:2016年12月01日 14:57:34   作者:愛(ài)喝酸奶的吃貨  
這篇文章主要為大家詳細(xì)介紹了基于vue.js實(shí)現(xiàn)圖片輪播效果,vue如何實(shí)現(xiàn)輪播圖效果,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

本文實(shí)例為大家分享了vue圖片輪播的具體代碼,供大家參考,具體內(nèi)容如下

輪播圖效果:

1.html

<template>
 <div class="shuffling">
 <div class="fouce fl">
 <div class="focus">
 <ul class="showimg">
 <template v-for='sd in shufflingData'>
 <li v-if='shufflingId==$index' v-on:mouseover='showPreNext' v-on:mouseout='hiddenPreNext'>
 <a target="_blank" title="{{sd.title}}" class="img" href="{{sd.href}}"><img alt="{{sd.title}}" v-bind:src="sd.url"/></a>
 <h3><a target="_blank" title="{{sd.title}}" href="{{sd.href}}">{{sd.title}}</a></h3>
 </li>
 </template>
 </ul>
 <div class='bullet-pagination'>
 <a class="bullet" v-bind:class="{'active': shufflingId==0}" v-on:click='bulletFunOne'></a>
 <a class="bullet" v-bind:class="{'active': shufflingId==1}" v-on:click='bulletFunTwo'></a>
 <a class="bullet" v-bind:class="{'active': shufflingId==2}" v-on:click='bulletFunThree'></a>
 </div>
 <div v-show='PreNext' class="preNext pre" v-on:mouseover='showPreNext' v-on:mouseout='hiddenPreNext' v-on:click='preFun'></div>
 <div v-show='PreNext' class="preNext next" v-on:mouseover='showPreNext' v-on:mouseout='hiddenPreNext' v-on:click='nextFun'></div>
 </div>
 </div>
 </div>
</template>

2.js

<script>
export default {
 components: {
 },
 ready: function() {
 var _this=this;
 var timer = setInterval(function() {
 if(_this.shufflingId>=0&&_this.shufflingId<_this.shufflingData.length-1){
 _this.shufflingId=parseInt(_this.shufflingId)+1;
 }
 else if (_this.shufflingId==_this.shufflingData.length-1) {
 _this.shufflingId=0;
 }
 }, 5000)
 },
 methods: {
 bulletFunOne:function(){
 this.shufflingId=0;
 },
 bulletFunTwo:function(){
 this.shufflingId=1;
 },
 bulletFunThree:function(){
 this.shufflingId=2;
 },
 showPreNext:function(){
 this.PreNext=true;
 },
 hiddenPreNext:function(){
 this.PreNext=false;
 },
 preFun:function(){
 var _this=this;
 if(_this.shufflingId>0&&_this.shufflingId<_this.shufflingData.length){
 _this.shufflingId=parseInt(_this.shufflingId)-1;
 }
 },
 nextFun:function(){
 var _this=this;
 if(_this.shufflingId>=0&&_this.shufflingId<_this.shufflingData.length-1){
 _this.shufflingId=parseInt(_this.shufflingId)+1;
 }
 }
 },
 data() {
 return {
 shufflingData:[{
 title:'喵來(lái)個(gè)米',
 href:'1',
 url:'/xxx/xx/src/img/1.png'
 },
 {
 title:'豆豆',
 href:'2',
 url:'/xxx/xx/src/img/2.png'
 },{
 title:'貓咪咪',
 href:'3',
 url:'/xxx/xx/src/img/3.jpg'
 }],
 shufflingId:0,
 PreNext:false,
 }
 }
}
</script>

3.css

.fouce {
 position: relative;
 left:380px;
 overflow: hidden;
 height: 570px;
 width: 1100px;
}
.fl {
 float: left;
}
.focus{
 overflow: hidden;
}
.fouce ul {
 position: absolute;
}
.fouce ul li {
 float: left;
}
.fouce ul li a.img {
 display: block;
 height: 520px;
}
.showimg{
 width:1440px;
 left:-0px;
}
.showimg img {
 display: block;
 width:1100px;
 height:520px;
}
.fouce .bullet-pagination {
 position: absolute;
 bottom: 50px;
}
.fouce ul li h3 {
 height: 40px;
 line-height: 40px;
 background-color: #ededed;
 text-align: center;
 font-size: 25px;
 width: 1100px;
}
.bullet-pagination {
 width: 100%;
 text-align: center;
 padding-top: 16px;
 clear: both;
 overflow: hidden;
}
.bullet {
 display: inline-block;
 background: #fff;
 width: 12px;
 height: 12px;
 border-radius: 6px;
 -webkit-border-radius: 6px;
 margin-right: 5px;
 opacity: 0.8;
 -webkit-transition: opacity 0.8s linear;
 -moz-transition: opacity 0.8s linear;
 -ms-transition: opacity 0.8s linear;
 -o-transition: opacity 0.8s linear;
 transition: opacity 0.8s linear;
}
.bullet.active {
 background: #007cdb;
 opacity: 1;
 cursor: pointer;
}
.preNext {
 display: block;
 width: 31px;
 height: 41px;
 position: absolute;
 top: 200px;
 cursor: pointer;
}
.pre {
 background: url('/xxx/xx/src/img/news_arr_r.png') no-repeat right center;
}
.next {
 background: url('/xxx/xx/src/img/news_arr_r.png') no-repeat left center;
 right: 0px;
}
* {
 padding: 0;
 margin: 0;
 list-style: none;
}
a{
 text-decoration: none;
}

本文已被整理到了《Vue.js前端組件學(xué)習(xí)教程》,歡迎大家學(xué)習(xí)閱讀。

關(guān)于vue.js組件的教程,請(qǐng)大家點(diǎn)擊專(zhuān)題vue.js組件學(xué)習(xí)教程進(jìn)行學(xué)習(xí)。

精彩專(zhuān)題分享:jQuery圖片輪播 JavaScript圖片輪播 Bootstrap圖片輪播

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

  • Vue-cli創(chuàng)建項(xiàng)目從單頁(yè)面到多頁(yè)面的方法

    Vue-cli創(chuàng)建項(xiàng)目從單頁(yè)面到多頁(yè)面的方法

    本篇文章主要介紹了Vue-cli創(chuàng)建項(xiàng)目從單頁(yè)面到多頁(yè)面的方法,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧
    2017-09-09
  • Vue2.x-使用防抖以及節(jié)流的示例

    Vue2.x-使用防抖以及節(jié)流的示例

    這篇文章主要介紹了Vue2.x-使用防抖以及節(jié)流的示例,幫助大家更好的理解和學(xué)習(xí)使用vue框架,感興趣的朋友可以了解下
    2021-03-03
  • Vue+ElementUI 中級(jí)聯(lián)選擇器Bug問(wèn)題的解決

    Vue+ElementUI 中級(jí)聯(lián)選擇器Bug問(wèn)題的解決

    這篇文章主要介紹了Vue+ElementUI 中級(jí)聯(lián)選擇器Bug問(wèn)題的解決方法,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧
    2020-07-07
  • Vue中的v-model綁定修飾符的實(shí)現(xiàn)原理

    Vue中的v-model綁定修飾符的實(shí)現(xiàn)原理

    v-model 是Vue.js中的一個(gè)重要指令,通過(guò)它我們可以輕松實(shí)現(xiàn)數(shù)據(jù)的雙向綁定,本文介紹一些常用的 v-model 綁定修飾符,并解析它們的實(shí)現(xiàn)原理,感興趣的朋友一起看看吧
    2024-01-01
  • vue3實(shí)現(xiàn)搜索項(xiàng)超過(guò)n行就折疊的思路詳解

    vue3實(shí)現(xiàn)搜索項(xiàng)超過(guò)n行就折疊的思路詳解

    我們?cè)谧隽斜聿樵?xún)的時(shí)候,會(huì)有很多查詢(xún)項(xiàng),如何實(shí)現(xiàn)超過(guò)n行查詢(xún)項(xiàng)的時(shí)候自動(dòng)折疊起來(lái)呢?本文給大家分享vue3實(shí)現(xiàn)搜索項(xiàng)超過(guò)n行就折疊的思路詳解,感興趣的朋友一起看看吧
    2022-06-06
  • typescript+vite項(xiàng)目配置別名的方法實(shí)現(xiàn)

    typescript+vite項(xiàng)目配置別名的方法實(shí)現(xiàn)

    我們?yōu)榱耸÷匀唛L(zhǎng)的路徑,經(jīng)常喜歡配置路徑別名,本文主要介紹了typescript+vite項(xiàng)目配置別名的方法實(shí)現(xiàn),文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2022-07-07
  • vue-rx的初步使用教程

    vue-rx的初步使用教程

    這篇文章主要介紹了vue-rx的初步使用教程,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧
    2018-09-09
  • 解決vue-cli webpack打包后加載資源的路徑問(wèn)題

    解決vue-cli webpack打包后加載資源的路徑問(wèn)題

    今天小編就為大家分享一篇解決vue-cli webpack打包后加載資源的路徑問(wèn)題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧
    2018-09-09
  • elementUI中el-upload文件上傳的實(shí)現(xiàn)方法

    elementUI中el-upload文件上傳的實(shí)現(xiàn)方法

    ElementUI的組件支持多種事件鉤子,如http-request、before-upload和on-change,以實(shí)現(xiàn)自定義文件上傳處理,這篇文章主要介紹了elementUI中el-upload文件上傳的實(shí)現(xiàn)方法,需要的朋友可以參考下
    2024-11-11
  • 淺析在Vue中watch使用的必要性及其優(yōu)化

    淺析在Vue中watch使用的必要性及其優(yōu)化

    這篇文章主要來(lái)和大家深入討論一下在Vue開(kāi)發(fā)中是否有必要一定用watch,如果換成watcheffect會(huì)如何,文中的示例代碼講解詳細(xì),需要的可以參考下
    2023-12-12

最新評(píng)論

建瓯市| 新乡市| 德保县| 图木舒克市| 治多县| 鄂尔多斯市| 四平市| 淳安县| 桂东县| 界首市| 江山市| 汉寿县| 平武县| 加查县| 定西市| 定结县| 赤壁市| 鹿邑县| 庆阳市| 开远市| 麻江县| 米泉市| 萨嘎县| 罗定市| 宕昌县| 江西省| 利辛县| 江阴市| 威宁| 昭通市| 金华市| 收藏| 无棣县| 大洼县| 麻江县| 哈巴河县| 玉林市| 合阳县| 昌黎县| 宜昌市| 大化|