jQuery智能炫酷的翻页相册特效代码

版权:原创 更新时间:1年以上
[该文章底部包含文件资源,可根据自己情况,决定是否下载资源使用,时间>金钱,如有需要,立即查看资源]

以下是 jQuery智能炫酷的翻页相册特效代码 的示例演示效果:

当前平台(PC电脑)
  • 平台:

部分效果截图:

jQuery智能炫酷的翻页相册特效代码

HTML代码(index.html):

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jQuery智能炫酷的翻页相册</title>
<link rel="stylesheet" type="text/css" href="css/css.css"/>
<script src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/js.js"></script>
</head>
<body>
<div class="img-box">
         <span></span>
          <div><a href="#"><img src="images/1.jpg" /></a></div>
          <div><a href="#"><img src="images/2.jpg" /></a></div> 
          <div><a href="#"><img src="images/3.jpg" /></a></div>
          <div><a href="#"><img src="images/2.jpg" /></a></div>
</div>
<div class="btn-box">
    <div class="btn-margin">
        <div class="btn" id="btn-prev">上一张</div>
        <div class="btn" id="btn-next">下一张</div>
    </div>
</div>
</body>
</html>






JS代码(js.js):

// JavaScript Document$(document).ready(function(e){
	var ImgBox = $(".img-box"),ImgSpan =ImgBox.find("span"),ImgDiv = $(".img-box div"),BtnNext = $("#btn-next"),BtnPrve = $("#btn-prev"),Btn = $(".btn"),speed = 600,//设置动画的运动时间 Tick = 4000+speed,//设置定时器的间隔时间 n=1,//设置张数计数器 whichCl,//设置判断点击了哪一个按钮 z=0;
	//设置当前动画计数器 ImgSpan.html("第 "+n+" 张/共 "+ImgDiv.length+" 张");
	function Slider(){
	//动画函数 if(whichCl=="nextCl"){
	n++;
	if(n>ImgDiv.length){
	n=1;
}
z--;
	if(z<0){
	z=ImgDiv.length-1;
}
}
if(whichCl=="prevCl"){
	n--;
	if(n<1){
	n=ImgDiv.length;
}
}
ImgSpan.html("第 "+n+" 张/共 "+ImgDiv.length+" 张");
	ImgDiv.eq(z).stop().animate({
	right:-(1.1*ImgDiv.width())}
,speed,function(){
	if(whichCl=="nextCl"){
	ImgSpan.after($(this));
}
if(whichCl=="prevCl"){
	ImgBox.append($(this));
}
$(this).stop().animate({
	right:0}
,speed);
}
) if(whichCl=="prevCl"){
	z++;
	if(z>ImgDiv.length-1){
	z=0;
}
}
ImgBox.stop().animate({
	right:100}
,speed,function(){
	$(this).stop().animate({
	right:0}
,speed)}
) ImgSpan.stop().animate({
	left:395}
,speed,function(){
	$(this).stop().animate({
	left:295}
,speed)}
)}
BtnNext.click(next_cl = function(){
	whichCl="nextCl";
	Slider();
}
);
	//向右点击事件启动动画函数 BtnPrve.click(prev_cl = function(){
	whichCl="prevCl";
	Slider();
}
);
	//向左点击事件启动动画函数 Btn.hover(function(){
	clearTimeout(autoTime)}
,function(){
	autoTime = setInterval(next_cl,Tick);
}
)//当鼠标进入点击按钮时对定时器进行控制 autoTime = setInterval(next_cl,Tick);
	//模拟向右点击事件定时启动动画函数,也可以使用 prev_cl向左启动动画函数}
);
	

CSS代码(css.css):

@charset "utf-8";/* CSS Document */
body{overflow:hidden;}
a{text-decoration:none;color:#FFF;}
a img{border:none;}
.img-box,.img-box div,.img-box div img{width:800px;height:450px;}
.img-box{margin:auto;position:relative;}
.img-box span{position:absolute;bottom:0;left:295px;width:201px;font-size:12px;line-height:25px;color:#FFF;z-index:100;background:#555;text-align:center;}
.img-box div{position:absolute;cursor:all-scroll}
.btn-box{width:800px;height:40px;margin:auto;cursor:pointer;background:#222;}
.btn-margin{width:210px;height:40px;margin:auto;}
.btn{width:100px;height:38px;line-height:38px;margin:1px 1px 0 0;text-align:center;float:left;color:#FFF;background:#555;}
附件:下载该文件资源,减少时间成本(增值服务)
留言
该资源可下载
File Source
.rar
352.59 KB
最新结算
jquery虚拟键盘中文打字效果js代码
类型: .rar 金额: CNY 2.31¥ 状态: 待结算 详细>
jquery虚拟键盘中文打字效果js代码
类型: .rar 金额: CNY 0.29¥ 状态: 待结算 详细>
HTML5实现CSS滤镜图片切换特效代码
类型: .rar 金额: CNY 2.31¥ 状态: 待结算 详细>
jQuery头像裁剪插件cropbox js代码
类型: .rar 金额: CNY 0.29¥ 状态: 待结算 详细>
jQuery头像裁剪插件cropbox js代码
类型: .rar 金额: CNY 2.31¥ 状态: 待结算 详细>
CSS3制作3D图片立方体旋转特效
类型: .rar 金额: CNY 2.31¥ 状态: 待结算 详细>
CSS3制作3D图片立方体旋转特效
类型: .rar 金额: CNY 0.29¥ 状态: 待结算 详细>
CSS3制作3D图片立方体旋转特效
类型: .rar 金额: CNY 2.31¥ 状态: 待结算 详细>
CSS3制作3D图片立方体旋转特效
类型: .rar 金额: CNY 0.29¥ 状态: 待结算 详细>
jQuery+css3实现信封效果
类型: .rar 金额: CNY 0.29¥ 状态: 待结算 详细>
我们力求给您提供有用的文章,再此基础上,会附加营收资源,不做任何广告,让平台可以更好发展 若您发现您的权利被侵害,或使用了您的版权,请发邮件联系 sunlifel@foxmail.com ggbig觉得 : 不提供源码的文章不是好文章
合作伙伴
联系我们
  • QQ:21499807
  • 邮箱:sunlifel@foxmail.com
  • QQ扫一扫加QQ
    QQ扫一扫
Copyright 2023-2024 ggbig.com·皖ICP备2023004211号-1
打赏文章