轮播

小程序――banner轮播

匿名 (未验证) 提交于 2019-12-03 00:30:01
这是效果图。将默认的圆点变成短横线,当前活动的短横线较长并切是红色背景。以及轮播高度随着图片高度自适应。 代码如下: xml: <swiper class='swiper-box' indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" style='height:{{Height}}'> <block wx:for="{{ bannerUrls }}"> <swiper-item> <view> <image class="slide-image" src="{{ item.url }}" bindload='imgHeight' mode='widthFix'></image> </view> </swiper-item> </block> </swiper> js: Page({ data: { // 轮播 bannerUrls: [ { url: 'https://www.71big.com/heqing/zhaojingwang/common/images/banner1.jpg', linkUrl: '' }, { url: 'https://www.71big.com/heqing/zhaojingwang

图片轮播

匿名 (未验证) 提交于 2019-12-03 00:28:02
<!DOCTYPE HTML> <HTML> <HEAD> <META name="Generator" content="EditPlus"> <META name="Author" content="ResumeBB"> <META name="Keywords" content=""> <META name="Description" content=""> <TITLE> 图片轮播 </TITLE> <style> body,ul{ margin:0; } ul{ padding:0; } .banner{ width:1000px; height:650px; margin:50px auto; } .banner .pic{ position:relative; width:100%; height:100%; } .banner .pic li{ position:absolute; width:100%; height:100%; list-style:none; } .banner .pic li img{ width:100%; height:80%; transform:scale(0); opacity:0; transition:all 0.7s ease-in-out; } .banner .pic li input:checked + img{/*

NSTimer设置引导页自动轮播

匿名 (未验证) 提交于 2019-12-03 00:22:01
通过UIScrollView实现 签协议 < UIScrollViewDelegate > 定义属性 @property ( nonatomic , strong ) UIScrollView *yyScrollView; @property ( nonatomic , assign ) int conut; 代码如下: - (void)viewDidLoad { [super viewDidLoad] ; self .conut = 0 ; // 创建滚动视图,并设置其相关的属性 _yyScrollView = [[UIScrollView alloc] initWithFrame:self .view .frame ] ; [self .view addSubview:_yyScrollView] ; _yyScrollView .delegate = self ; _yyScrollView .pagingEnabled = YES ; _yyScrollView .bounces = NO ; _yyScrollView .contentSize = CGSizeMake(self .view .frame .size .width * 3 , 0 ) ; _yyScrollView .showsVerticalScrollIndicator = NO ; __weak

vue之better-scroll轮播

匿名 (未验证) 提交于 2019-12-03 00:19:01
想吐槽啊,网上看了那么多文章,写来写去,一大堆,就是一个简单的利用better-scroll来制作的一个轮播效果,搞不明白为啥那么多代码。。。 html: <template> <div class="banner-warpper" ref="banner"> <div class="banner-group" ref="bannerGroup" > <div class="banner-item" :key="item.img" v-for="item in banner"><router-link :to="item.link"><img :src="item.img" ></router-link></div> </div> <div class="banner-dots" v-show="dots"> <div class="dots-item" v-for="(item,index) in banner" :key="index" :class="index === actives ? 'active' : ''"></div> </div> </div> </template> js: <script> import BScroll from 'better-scroll'; export default { name: 'banner', props: {

二十、JS轮播停留效果

匿名 (未验证) 提交于 2019-12-03 00:18:01
function move () { box .className = "box anmint" ; circle [ count ].style.backgroundColor = "" ; count ++ ; box .style.marginLeft = ( - 800 * count ) + "px" ; setTimeout ( function () { if ( count >= 6 ) { count = 0 ; box .className = "box" ; box .style.marginLeft = "0px" ; circle [ count ].style.backgroundColor = "red" ; 500 ); } for ( var j = 0 ; j < circle .length; j ++ ){ circle [ j ]. index = j ; circle [ j ]. onmouseenter =function (){ for ( var k = 0 ; k < circle .length; k ++ ){ circle [ k ].style.backgroundColor = "" ; this .style.backgroundColor = "red" ; box .className = "box anmint

es6的class类封装轮播图

匿名 (未验证) 提交于 2019-12-03 00:11:01
话不多说,直接上代码 <!DOCTYPE html> <html lang = "en" > <head> <meta charset = "UTF-8" > <title> Title </title> <script></script> <style> * { margin : 0 ; padding : 0 ; } . box { width : 400px ; height : 350px ; border : 1px solid red ; overflow : hidden ; margin : auto ; margin - top : 50px ; position : relative ; top : 0 ; left : 0 ; } . outer { list - style : none ; position : absolute ; top : 0 ; left : 0 ; transition : . 3s all linear ; } . img { width : 400px ; height : 350px ; float : left ; } . left { position : absolute ; top : 200px ; right : 0 ; display : none ; } . right { position :

vue实现轮播效果

匿名 (未验证) 提交于 2019-12-03 00:06:01
vue实现轮播效果 效果如下:(不好意思,图有点大;) 功能:点击左侧图片,右侧出现相应的图片;同时左侧边框变颜色。 代码如下:(也可以直接下载文件) <!DOCTYPE html> <html lang = "en" > <head> <meta charset = "utf-8" > <title> test </title> <script src = "vue.js" ></script> </head> <body> <div id = "app" > <!-- 左侧img图片 --> <div class = "leftlList " > <div v-for = "(leftImg,index) in leftImgs" : key = "index" > <label : key = "index + 'A'" > {{ index + 1 }} </label> <div @ click = "clickImg(index)" : key = "index + 'B'" class = "img" : class = "[leftIndex == index?'listImgActived': '']" > <img : src = "leftImg.url" > <!-- 11111 --> </div> </div> </div> <!-- 分割线 -->

定时器轮播,轮播一次加载一张图;

匿名 (未验证) 提交于 2019-12-03 00:03:02
<!DOCTYPE html> <html> <head> <meta charset="UTF-8" /> <title>1</title> <style type="text/css"> #second_div { width: 1462px; height: 296px; position: relative; } .img_box { overflow: hidden; width: 1462px; height: 296px; border: 1px solid; position: relative; } .img_box img { width: 1462px; height: 296px; position: absolute; } .dian { list-style: none; position: absolute; right: 60px; bottom: 10px; } .dian li { float: left; margin-left: 20px; width: 10px; height: 10px; border-radius: 50%; background: gray; } </style> <body> <div id="second_div"> <div class="img_box"> </div> <ul class="dian"><

js简单轮播图

匿名 (未验证) 提交于 2019-12-03 00:02:01
window.οnlοad=function(){ var img=document.getElementById("img"); var listImg=document.getElementById("list-img") // 定义一个变量 var count=1; // 定义一个函数 function changeImgeSrc(){ count++; img.src="img/"+count+".jpg" // 判断 if(count==4){ count=1 } } // 定时器 window.setInterval(changeImgeSrc,2000) } 来源:51CTO 作者: 让代码飞1926 链接:https://blog.csdn.net/qq_40596257/article/details/100707059