zoukankan      html  css  js  c++  java
  • jquery.imageScroller实现图片滚动

    jQuery的一个不错的小插件,jquery.imageScroller.js代码:
    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.     <title>jQuery无缝滚动</title>
    5.     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    6.     <script type="text/javascript" src="http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2.min.js"></script>
    7.     <script type="text/javascript" src="http://img.rbtvs.com/js/jquery.imageScroller.js"></script>
    8.     <style type="text/css">
    9.         *
    10.         {
    11.             list-style: none;
    12.             font-size: 12px;
    13.             padding: 0;
    14.             margin: 0;
    15.         }
    16.         
    17.         #list li
    18.         {
    19.             90px;
    20.             height: 18px;
    21.             line-height: 18px;
    22.             text-align: center;
    23.             padding: 41px 0;
    24.             float: left;
    25.             margin: 0 5px;
    26.             background-color: Aqua;
    27.         }
    28.         
    29.         #btnPrev, #btnNext, #listBox
    30.         {
    31.             float: left;
    32.         }
    33.         
    34.         #btnPrev, #btnNext
    35.         {
    36.             30px;
    37.             height: 18px;
    38.             line-height: 18px;
    39.             padding: 41px 0;
    40.             background: #ff9;
    41.             text-align: center;
    42.         }
    43.         
    44.         #listBox
    45.         {
    46.             400px;
    47.             height: 100px;
    48.             overflow: hidden;
    49.             background: #000;
    50.         }
    51.         
    52.         #container
    53.         {
    54.             460px;
    55.             height: 100px;
    56.             background: red;
    57.             position: absolute;
    58.             left: 50%;
    59.             top: 50%;
    60.             margin-left: -230px;
    61.             margin-top: -50px;
    62.         }
    63.     </style>
    64.     <script type="text/javascript">

    65.         $(function () {
    66.             $("#listBox").imageScroller({
    67.                 next: "btnNext",
    68.                 prev: "btnPrev",
    69.                 frame: "list",
    70.                 child: "li",
    71.                 auto: true
    72.             });
    73.         });
    74.     </script>
    75. </head>
    76. <body>
    77.     <div id="container">
    78.         <div id="btnNext" title="上一个">
    79.             <<
    80.         </div>
    81.         <div id="listBox">
    82.             <ul id="list">
    83.                 <li>001</li>
    84.                 <li>002</li>
    85.                 <li>003</li>
    86.                 <li>004</li>
    87.                 <li>005</li>
    88.                 <li>006</li>
    89.                 <li>007</li>
    90.                 <li>008</li>
    91.                 <li>009</li>
    92.             </ul>
    93.         </div>
    94.         <div id="btnPrev" title="下一个">
    95.             >>
    96.         </div>
    97.     </div>
    98. </body>
    99. </html>
    复制代码
    在线演示:

    如果您不想当成插件来用,里面的代码也可以单独扒出来(麦考林首页就是这么用的)
  • 相关阅读:
    STL算法概述
    pentaho DI Tutorial (spoon)
    pentaho DIGet Started (spoon)
    Apache Tomcat 7学习笔记(一) 介绍tomcat7
    蜻蜓resin3.1配置文件中文注释
    CentOS防火墙开启、关闭以及开放指定端口
    CentOS5.6蜻蜓resin服务器的搭建
    (总结)RHEL/CentOS 5.x使用第三方软件库(EPEL与RPMForge、RPMFusion软件库)
    用yum安装lamp环境
    蜻蜓resin服务器虚拟目录的设置
  • 原文地址:https://www.cnblogs.com/luowei/p/2722738.html
Copyright © 2011-2022 走看看