运行代码 缩小
十度
HTML代码
复制 格式化 注释 注释 清空
放大
x
 
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
<html xmlns="http://www.w3.org/1999/xhtml">
3
    <head>
4
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
        <title>jQuery-插件-图片左右无缝滚动
6
        </title>
7
        <script type="text/javascript" src="http://ku.shouce.ren/libs/jquery/1/jquery1.8.0.min.js">
8
        </script>
9
    </head>
10
    <body>
11
        <div class="friend-Link">
12
            <div class="left-arrow">
13
                <a href="#">左边箭头
14
                </a>
15
            </div>
CSS代码
复制 格式化 注释 注释 颜色 清空
放大
xxxxxxxxxx
53
 
1
*{
2
  margin:0;
3
  padding:0;
4
}
5
a img{
6
  border:none;
7
}
8
.friend-Link{
9
  position:relative;
10
  margin:10px auto 17px auto;
11
  width:903px;
12
  height:117px;
13
  background:url(/upload/files/201604/91bf99a05d1.gif) repeat-x 0 0;
14
}
15
.left-arrow,.fl-pic,.right-arrow{
JS代码
复制 格式化 注释 注释 清空
放大
xxxxxxxxxx
47
 
1
(function($){
2
    $.fn.extend({
3
        "slidelf":function(value){
4
            value = $.extend({
5
                "prev":"",
6
                "next":"",
7
                "speed":""  
8
            },value)
9
            
10
            var dom_this = $(this).get(0);  //将jquery对象转换成DOM对象;以便其它函数中调用;
11
            var marginl = parseInt($("ul li:first",this).css("margin-left")); //每个图片margin的数值
12
            var movew = $("ul li:first",this).outerWidth()+marginl; //需要滑动的数值
13
            
14
            //左边的动画
15
            function leftani(){
名称
jQuery-插件-图片左右无缝滚动
分类
图片代码
描述
图片左右无缝滚动简单版
收藏