实现一个幻灯片轮播


<!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" />
<script type="text/javascript" src="jquery.1.4.2-min.js"></script>
<script type="text/javascript" src="jquery.easing.1.3.js"></script>
<script type="text/javascript" src="jquery.bq.js"></script>
<script type="text/javascript">$(document).ready(function() {BannerImages();//Banner滑动效果
    });
</script>
<title>幻灯片图片轮播切换</title>
</head>
<body><style type="text/css">
* {margin: 0;padding: 0;list-style-type: none;
}a,img {border: 0;
}body {font: 12px/180% Arial, Helvetica, sans-serif, "新宋体";
}
/* changeBox */
.changeBox {position: relative;height: 397px;width: 732px;overflow: hidden;margin: 30px auto;
}.changeBox_imgs {position: relative;height: 354px;width: 732px;overflow: hidden;clear: both;
}.changeBox_imgs_list {position: absolute;width: 9999px;
}.changeBox_imgs_list li {float: left;height: 354px;width: 732px;
}
</style><div id="change" class="changeBox"><div class="changeBox_imgs"><ul class="changeBox_imgs_list"><li><a href="#" target="_blank"><img width="732"height="354" alt="白强" src="data:images/banner1.jpg" /></a></li><li><a href="#" target="_blank"><img width="732"height="354" alt="白强" src="data:images/banner2.jpg" /></a></li><li><a href="#" target="_blank"><img width="732"height="354" alt="白强" src="data:images/banner3.jpg" /></a></li></ul></div></div>
</body>
</html>


相关的文件

jquery.bq.js

function BannerImages() {var e = $("ul.changeBox_imgs_list"), f = 1;var a = function() {var j = (732 * f - 732), j = j == 0 ? 0 : -j;console.log(j);e.animate({left : j + "px"}, {queue:false,
duration:500, easing: 'jswing'});};var h = null;var g = function() {h = setInterval(function() {f++;if (f > 3) {f = 1}a();}, 3000)};g();};


jquery.easing.1.3.js

/** jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/** Uses the built in easing capabilities added In jQuery 1.1* to offer multiple easing options** TERMS OF USE - jQuery Easing* * Open source under the BSD License. * * Copyright © 2008 George McGinley Smith* All rights reserved.* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met:* * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer.* Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution.* * Neither the name of the author nor the names of contributors may be used to endorse * or promote products derived from this software without specific prior written permission.* * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE*  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,*  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE*  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING*  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. *
*/// t: current time, b: begInnIng value, c: change In value, d: duration
jQuery.easing['jswing'] = jQuery.easing['swing'];jQuery.extend( jQuery.easing,
{def: 'easeOutQuad',swing: function (x, t, b, c, d) {//alert(jQuery.easing.default);return jQuery.easing[jQuery.easing.def](x, t, b, c, d);},easeInQuad: function (x, t, b, c, d) {return c*(t/=d)*t + b;
    },easeOutQuad: function (x, t, b, c, d) {return -c *(t/=d)*(t-2) + b;
    },easeInOutQuad: function (x, t, b, c, d) {if ((t/=d/2) < 1) return c/2*t*t + b;return -c/2 * ((--t)*(t-2) - 1) + b;
    },easeInCubic: function (x, t, b, c, d) {return c*(t/=d)*t*t + b;
    },easeOutCubic: function (x, t, b, c, d) {return c*((t=t/d-1)*t*t + 1) + b;
    },easeInOutCubic: function (x, t, b, c, d) {if ((t/=d/2) < 1) return c/2*t*t*t + b;return c/2*((t-=2)*t*t + 2) + b;
    },easeInQuart: function (x, t, b, c, d) {return c*(t/=d)*t*t*t + b;
    },easeOutQuart: function (x, t, b, c, d) {return -c * ((t=t/d-1)*t*t*t - 1) + b;
    },easeInOutQuart: function (x, t, b, c, d) {if ((t/=d/2) < 1) return c/2*t*t*t*t + b;return -c/2 * ((t-=2)*t*t*t - 2) + b;
    },easeInQuint: function (x, t, b, c, d) {return c*(t/=d)*t*t*t*t + b;
    },easeOutQuint: function (x, t, b, c, d) {return c*((t=t/d-1)*t*t*t*t + 1) + b;
    },easeInOutQuint: function (x, t, b, c, d) {if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;return c/2*((t-=2)*t*t*t*t + 2) + b;
    },easeInSine: function (x, t, b, c, d) {return -c * Math.cos(t/d * (Math.PI/2)) + c + b;},easeOutSine: function (x, t, b, c, d) {return c * Math.sin(t/d * (Math.PI/2)) + b;},easeInOutSine: function (x, t, b, c, d) {return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;},easeInExpo: function (x, t, b, c, d) {return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
    },easeOutExpo: function (x, t, b, c, d) {return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
    },easeInOutExpo: function (x, t, b, c, d) {if (t==0) return b;if (t==d) return b+c;if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
    },easeInCirc: function (x, t, b, c, d) {return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
    },easeOutCirc: function (x, t, b, c, d) {return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
    },easeInOutCirc: function (x, t, b, c, d) {if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
    },easeInElastic: function (x, t, b, c, d) {var s=1.70158;var p=0;var a=c;if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;if (a < Math.abs(c)) { a=c; var s=p/4; }else var s = p/(2*Math.PI) * Math.asin (c/a);return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
    },easeOutElastic: function (x, t, b, c, d) {var s=1.70158;var p=0;var a=c;if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;if (a < Math.abs(c)) { a=c; var s=p/4; }else var s = p/(2*Math.PI) * Math.asin (c/a);return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
    },easeInOutElastic: function (x, t, b, c, d) {var s=1.70158;var p=0;var a=c;if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) p=d*(.3*1.5);if (a < Math.abs(c)) { a=c; var s=p/4; }else var s = p/(2*Math.PI) * Math.asin (c/a);if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
    },easeInBack: function (x, t, b, c, d, s) {if (s == undefined) s = 1.70158;return c*(t/=d)*t*((s+1)*t - s) + b;
    },easeOutBack: function (x, t, b, c, d, s) {if (s == undefined) s = 1.70158;return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
    },easeInOutBack: function (x, t, b, c, d, s) {if (s == undefined) s = 1.70158; if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
    },easeInBounce: function (x, t, b, c, d) {return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;},easeOutBounce: function (x, t, b, c, d) {if ((t/=d) < (1/2.75)) {return c*(7.5625*t*t) + b;} else if (t < (2/2.75)) {return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;} else if (t < (2.5/2.75)) {return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;} else {return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
        }},easeInOutBounce: function (x, t, b, c, d) {if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;}
});/*** TERMS OF USE - EASING EQUATIONS* * Open source under the BSD License. * * Copyright © 2001 Robert Penner* All rights reserved.* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met:* * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer.* Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution.* * Neither the name of the author nor the names of contributors may be used to endorse * or promote products derived from this software without specific prior written permission.* * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE*  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,*  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE*  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING*  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. **/

转载于:https://www.cnblogs.com/bq12345/p/3422492.html

自己实现一些JQuery插件-----------------------------------(一)相关推荐

  1. jQuery插件thickbox在ie下垂直居中问题

    jQuery 插件 thickbox 3.1 在ie下总不能垂直居中,按"http://jamazon.co.uk/web/2008/03/17/thickbox-31-ie7-positi ...

  2. 自己开发开源jquery插件--给jquery.treeview加上checkbox

    很多时候需要把树状的数据显示除来,比如分类,中国省份.城市信息,等,因此这方面的javascript插件也有很多.比如性能优异的jquery.treeview和国人开发的功能强大的zTree. 我最近 ...

  3. 推荐两款简单好用的图片放大jquery插件

    一.zoomfiy.js 推荐可以从这里下载 使用说明: 使用该jquery 插件 引入该插件的js:zoomfiy.js 或 min 引入该插件的css:zoomfiy.css 或 min 前后顺序 ...

  4. 动感效果的TAB选项卡 jquery 插件

    动感效果的TAB选项卡 jquery 插件 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" &q ...

  5. 【JQUBAR1.1】jQuery 插件发布

    [JQUBAR1.1]jQuery 插件发布 JQUBAR1.1 简介 2010-11-22在博客园发布了柱状图JQUBar1.0 jQuery 插件.现将该插件升级为1.1版本. 1.1版本修复了部 ...

  6. 240个jquery插件

    240个jquery插件 http://www.kollermedia.at/archive/2007/11/21/the-ultimate-jquery-plugin-list/ File uplo ...

  7. 基于Jquery插件Uploadify实现实时显示进度条上传图片

    网址:http://www.jb51.net/article/83811.htm 这篇文章主要介绍了基于Jquery插件Uploadify实现实时显示进度条上传图片的相关资料,感兴趣的小伙伴们可以参考 ...

  8. 51 jQuery插件库

    技术交流QQ群:1027579432,欢迎你的加入! 欢迎关注我的微信公众号:CurryCoder的程序人生 1.jQuery插件 jQuery功能比较有限,想要更复杂的特效功能,可以借助于jQuer ...

  9. 开源炫酷css轮播图 可直接引入html文件使用 含注释 jQuery插件

    开源炫酷css轮播图 可直接引入html文件使用 含注释 jQuery插件 1.轮播图样式 上图: 请访问:这里!! 查看轮播图效果. 2.如何在html里面引用 文件的目录路径为: 需要轮播图插件的 ...

  10. jquery插件制作

    jquery插件丰富,很多都是很好用的,最近学习了一下如何制作jquery插件,发现jquery插件制作其实很简单,这里介绍一下. jquery插件的基本格式: (function($){$.fn.t ...

最新文章

  1. java中怎样避免方法被重写
  2. jQuery 多个 classes 选择器
  3. 基于FPGA的FFT变换实现
  4. 进入正在运行的Docker容器的4种方式
  5. NoSQL-MongoDB with python
  6. 2020中国消费金融行业研究报告
  7. Github部署+Hexo搭建免费博客 next主题美化
  8. WCF技术剖析之二十三:服务实例(Service Instance)生命周期如何控制[上篇](转)...
  9. mongoVue 对mongodb的操作
  10. 采用计算机发布调度命令时 必须严格遵守,调度命令规范格式(公文命令).doc...
  11. 前端工程师的摸鱼日常(9)
  12. Matlab 多行屏蔽或注释方法
  13. 【软件设计师中级】设计模式之原型模式学习笔记(c++)
  14. 论文解读:Structural Optimization Makes Graph Classification Simpler and Better
  15. 谷歌浏览器怎么开启硬件加速模式 硬件加速模式开启方法简述
  16. CANoe测试:CAPL Test Module的2种创建方式
  17. 私域运营是不是就是社群运营?
  18. Java项目使用jib打包docker镜像的简单记录
  19. Android 架构组件之 Room
  20. Imagenet数据集1000类别中英文

热门文章

  1. Could not find a suitable table factory for ‘org.apache.flink.table.factories.TableSinkFactory‘
  2. AttributeError: 'StatusHandler' object has no attribute 'async_callback'
  3. xfce的开始菜单增加搜索框
  4. Gauss-Newton算法代码详细解释(转载+自己注释)
  5. wine: Unhandled page fault on read access to 0x00000000 at address 0x10b1fb8
  6. 1SE rule details in CCP pruning of CART
  7. 文件路径中 / 和 ./ 和 ../的区别
  8. php fastcgi,配置apache以fastcgi运行php
  9. udp本地通信需要注意哪些方面_验房注意什么?验房都需要检查哪些方面?
  10. python调用远程的python文件_python 实现调用远程接口