利用外层的块级元素负外边距来滚动

1.使用

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>index</title>
    
        <script type="text/javascript" src="/jq.js"></script>
        
        <!-- Date: 2014-02-23 -->
        <style type="text/css">
        /**
         *     
         * IE6中需要这样设置才会起作用
         */
            *{
                margin: 0;
                padding: 0;
            }
        </style>
    </head>
    <body>
<div style="overflow:hidden;">
    <div style="overflow: hidden;height: 50px;">
        <ul class="iscroll">
            
            <li >1</li>
            <li >2</li>
            <li>3</li>
        </ul>
        
    </div>
</div>
<script type="text/javascript" src="/jqplug/iscroll.js"></script>
<script type="text/javascript">
            $('.iscroll').iscroll({
                s:35
            });
        </script>
    </body>
</html>
View Code

相关文章:

  • 2022-12-23
  • 2021-10-05
  • 2021-11-18
  • 2021-06-29
  • 2021-08-25
  • 2022-12-23
  • 2021-09-30
  • 2022-12-23
猜你喜欢
  • 2021-06-11
  • 2021-08-25
  • 2022-12-23
  • 2021-11-05
  • 2021-09-03
  • 2022-12-23
相关资源
相似解决方案