jq 轮播图 上下自动滚动
<!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>无标题文档</title>
<style>
*{margin:;padding:;font-size:13px;font-family: microsoft yahei}
li{list-style:none}
#wrap{width:470px;height:150px;margin:40px auto; }
#packet{width:470px;height:150px;overflow:hidden;position:relative}
#packet ul{ position:absolute;top:;left:}
#slide li{ width:470px;height:150px;position:relative;top:;left: }
#packet ol{position:absolute;right:5px;bottom:5px;}
#packet ol li{width:20px;height:20px;text-align:center;line-height:20px;background:orange; float: left;margin: 2px}
#packet ol li.active{background:#E54829}
</style>
<script src="../../../../jquery-1.11.1.min.js"></script>
<script>
window.onload=function(){
var oPacket=document.getElementById("packet");
var oUl=document.getElementById("slide");
var aLi=oUl.getElementsByTagName("li");
var timer=null;
var iNow=;
var iNow2=;
//创建oL
var oL=document.createElement("ol");
var str="";
for(var i=;i<aLi.length;i++)
{
str+="<li>"+(i+)+"</li>"
}
oL.innerHTML=str;
oPacket.appendChild(oL);
var aLi1=oL.getElementsByTagName("li"); function init(){
for(var i=;i<aLi1.length;i++){
aLi1[i].className=''
}
aLi1[iNow].className='active'
}
init(); for(var i=;i<aLi1.length;i++){ aLi1[i].onmouseover=function(){
clearInterval(timer);
$('#slide').stop(true);
iNow=$(this).index();
iNow2=$(this).index();
init(); $('#slide').animate({'top':-*$(this).index()}); }
aLi1[i].onmouseout=function(){
timer=setInterval(toRun,);
} } timer=setInterval(toRun,);
function toRun(){
if(iNow==aLi.length-){
iNow=; $(aLi).eq().css({'position':'relative','top':'750px'})
}else{
iNow++;
}
iNow2++;
init(); $('#slide').animate({'top':-*iNow2},,function(){
if(iNow==){
$(aLi).eq().css('position','static');
$('#slide').css('top','0px');
iNow2=
}
})
} }
</script>
</head> <body>
<div id="wrap">
<div id="packet">
<ul id="slide">
<li><img src="data:images/1.jpg"/></li>
<li><img src="data:images/2.jpg"/></li>
<li><img src="data:images/3.jpg"/></li>
<li><img src="data:images/4.jpg"/></li>
<li><img src="data:images/5.jpg"/></li>
</ul>
</div>
</div>
</body>
</html>
jq 轮播图 上下自动滚动的更多相关文章
- iOS 图片轮播图(自动滚动)
iOS 图片轮播图(自动滚动) #import "DDViewController.h" #define DDImageCount 5 @interface DDViewContr ...
- jquery tab选项卡、轮播图、无缝滚动
最近做一个页写了一个星期,觉得自己对jquery还是很不熟悉 自己查了一下资料写了几个封装好的tab选项卡.轮播图.无缝滚动 $(function(){ //tab选项卡 jQuery.tab=fun ...
- jq轮播图插件
/* * 使用说明 * * 1:需要提供一个标签 * 2:lis:图片的个数 * 3:轮播图的大小 width ,height * 4:图片的地址imgs[0].carou ...
- jq 轮播图
<style> #focus{width:500px;height:200px;overflow:hidden;/*用一个div把图片包含设置超出范围隐藏*/} </style> ...
- jq轮播图
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- jq轮播图插件—手写
<!DOCTYPE html><html lang="en"> <head> <meta charset="UTF-8" ...
- 【微信小程序】:实现轮播图3秒滚动
wxml模板:(数据一维数组) <scroll-view scroll-y="true"> <swiper autoplay="auto" i ...
- jq 轮播图 转载-周菜菜
<style> li{list-style-type:none ; display:inline; width:90px; height:160px; float:left; } .pic ...
- jq轮播图实现
html基本框架如下: <div class="out"> <ul class="img"> <li><a href= ...
随机推荐
- easyui- comobo 详细讲解
具体代码实现 @{ ViewBag.Title = "人员查找"; ViewBag.LeftWidth = "200px"; ViewBag. ...
- Set-----集合入门
函数中的集合和 数学中的集合 基本上差不多 集合中每个元素最多只能出现一次 并且 当元素储存到set集合之中 会自动 按照 ascll 进行 从小到大的 排序 大神关于 set 的 详 ...
- 取消安卓listview,scrollview,gridview滑动时候边缘模糊问题
只需在xml文件里面声明: android:faddingEdge = "none" android:faddingEdgelenth = "0dp" andr ...
- Java中static方法
今天学习到了并且应用到了java中的静态方法,并且了解到它的好处与缺点. ● 生命周期(Lifecycle): 静态方法(Static Method)与静态成员变量一样,属于类本身,在类装载的时候被装 ...
- Squirrel的安装(windows上Phoneix可视化工具)
一.下载安装 下载地址:http://www.squirrelsql.org/下载所需版本 或者 从网址http://www.squirrelsql.org/下载相应版本的squirrel ...
- mybatis or
这两天项目用到mybatis,碰到and or的联合查询,语句像这样的 select * from table where xxx = "xxx" and (xx1="x ...
- VS插件-Resharper
最近代码因为Resharper出现了点问题,同事问我这个插件有什么用,下面就列几个最近常用的功能.其他功能后续慢慢更新 1.什么是Resharper ReSharper是一个JetBrains公司出品 ...
- Leetcode0457--Circular Array Loop
[转载请注明]https://www.cnblogs.com/igoslly/p/9339478.html class Solution { public: bool circularArrayLoo ...
- [Windows Server 2012] 网页Gzip压缩
★ 欢迎来到[护卫神·V课堂],网站地址:http://v.huweishen.com★ 护卫神·V课堂 是护卫神旗下专业提供服务器教学视频的网站,每周更新视频.★ 本节我们将带领大家:启用网站GZI ...
- (转)OGNL与值栈
http://blog.csdn.net/yerenyuan_pku/article/details/67709693 OGNL的概述 什么是OGNL 据度娘所说: OGNL是Object-Graph ...