189 8069 5689

图片滚动jquery,图片滚动操作方法

使用jQuery实现图片循环滚动效果,当把光标移动图上,停止滚动;当把光标从图上移出后,图片继续滚动

 !DOCTYPE html

成都创新互联技术团队10多年来致力于为客户提供成都网站设计、做网站、品牌网站制作全网整合营销推广、搜索引擎SEO优化等服务。经过多年发展,公司拥有经验丰富的技术团队,先后服务、推广了上千家网站,包括各类中小企业、企事单位、高校等机构单位。

html lang="en"

head

meta charset="UTF-8"

link rel="stylesheet" href=""

style

.swiper-wrapper {

height: 300px;

}

.swiper-slide {

display: flex;

justify-content: center;

align-items: center;

}

.swiper-slide:nth-child(1) {

background: red;

}

.swiper-slide:nth-child(2) {

background: green;

}

.swiper-slide:nth-child(3) {

background: blue;

}

/style

/head

body

div class="swiper-container"

div class="swiper-wrapper"

div class="swiper-slide"Slide 1/div

div class="swiper-slide"Slide 2/div

div class="swiper-slide"Slide 3/div

/div

/div

/body

script src=""/script

script language="javascript"

var mySwiper = new Swiper(document.querySelector(".swiper-container"), {

autoplay: true,

})

document.querySelector('.swiper-container').onmouseover = () = {

mySwiper.autoplay.stop();

}

document.querySelector('.swiper-container').onmouseout = () = {

mySwiper.autoplay.start();

}

/script

/html

 请采纳

jquery图片滚动特效疑问 scrollpic

你需要每次点击标签切换的时候 都执行一次点击箭头的事件 就可以了(或者初始化一下)

意思就是当你 切换标签的时候 让滚动执行完毕

有没有Jquery图片滚动相关的教程?

然后在得出滚动内容全部滚出,则又将内容插回来。原理就是:将需要滚动的地方,

取出,

复制1下,

相当于就是无缝滚动了。很简洁的,

我从0开始写过1个。

jquery点击按钮图片上下滚动怎么做?

!DOCTYPE html

html lange="en"

head

title点击左右按钮图片横向滚动/title

meta charset=utf-8" /

style type="text/css"

* { margin:0; padding:0;}

body { font-size:12px;}

.box {height:66px; float:left; width:440px; overflow: hidden; position:relative; }

.box

li { display:block; float:left; margin-left:5px; margin-right:5px;

width:100px;

height:70px;background:#BBB;font-size:50px;color:#ccc;line-height:66px;text-decoration:none;text-align:center;

cursor:pointer;}

.box li:hover { color:#999; }

.box li.active { background-position:-174px 0; color:#555;cursor:default;}

a.prev,

a.next {background:url()

no-repeat 0 0; display:block;width:23px;height:43px; float:left;

margin:15px 0 0 0; cursor:pointer;}

a.next { background-image:url()}

.scroll_list{ width:10000em; position:absolute; }

/style

!-- 引入jQuery --

script src="" type="text/javascript"/script

script type="text/javascript"

$(function(){

var page= 1;

var i = 4;//每版四个图片

//向右滚动

$(".next").click(function(){ //点击事件

var v_wrap = $(this).parents(".scroll"); // 根据当前点击的元素获取到父元素

var v_show = v_wrap.find(".scroll_list"); //找到视频展示的区域

var v_cont = v_wrap.find(".box"); //找到视频展示区域的外围区域

var v_width = v_cont.width();

var len = v_show.find("li").length; //我的视频图片个数

var page_count = Math.ceil(len/i); //只要不是整数,就往大的方向取最小的整数

if(!v_show.is(":animated")){

if(page == page_count){

v_show.animate({left:'0px'},"slow");

page =1;

}else{

v_show.animate({left:'-='+v_width},"slow");

page++;

}

}

});

//向左滚动

$(".prev").click(function(){ //点击事件

var v_wrap = $(this).parents(".scroll"); // 根据当前点击的元素获取到父元素

var v_show = v_wrap.find(".scroll_list"); //找到视频展示的区域

var v_cont = v_wrap.find(".box"); //找到视频展示区域的外围区域

var v_width = v_cont.width();

var len = v_show.find("li").length; //我的视频图片个数

var page_count = Math.ceil(len/i); //只要不是整数,就往大的方向取最小的整数

if(!v_show.is(":animated")){

if(page == 1){

v_show.animate({left:'-='+ v_width*(page_count-1)},"slow");

page =page_count;

}else{

v_show.animate({left:'+='+ v_width},"slow");

page--;

}

}

});

});

/script

/head

body

!-- 例子 --

div class="scroll" style="margin:0 auto;width:550px;"

!-- "prev page" link --

a class="prev" href="#"/a

div class="box"

div class="scroll_list"

ul

li1/li

li2/li

li3/li

li4/li

li5/li

li6/li

li7/li

li8/li

li9/li

li10/li

li11/li

li12/li

li13/li

li14/li

li15/li

li16/li

/ul

/div

/div

!-- "next page" link --

a class="next" href="#"/a

/div

/body

/html


新闻名称:图片滚动jquery,图片滚动操作方法
网站地址:http://cdxtjz.cn/article/phhecg.html

其他资讯