您好,欢迎来到五一七教育网。
搜索
您的当前位置:首页javascript实现列表滚动的方法_javascript技巧

javascript实现列表滚动的方法_javascript技巧

来源:五一七教育网
 本文实例讲述了javascript实现列表滚动的方法。分享给大家供大家参考。具体如下:

index.html如下:




 
 
 
 
 
 
 图片列表滚动



 

  • information1

  • information2

  • information3

  • information4

  • information5

  • information6

  • information7

  • information8

  • information9

  • information10

  • information11

  • information12

  • information13

  • information14

  • scroll_img.js如下:

    
    
    

    global.css如下:

    /*CSS reset*/
    body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td{margin:0;padding:0;font-family:arial,"宋体";}
    table{border-collapse:collapse;border-spacing:0;}
    fieldset,img{border:0;}
    address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:bold;}
    ol,ul{list-style-type:none;}
    caption,th{text-align:left;}
    h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}/*font-size:100%;的作用主要是改变它默认的大小,继承父体的字体大小*/
    q:before,q:after{content:' ';}
    abbr,acronym{border:0;}
    .cb{clear:both;}
    .cl{clear:left;}
    .cr{clear:right;}
    .clearfix:after{content:".";display:block;height:0;clear:both;visibility:hidden;}
    .clearfix{display:inline-block;}
    * html .clearfix{height:1%;}
    .clearfix{display:block;}
    /*主体css*/
    .scroll_img_wrap{width:612px;margin: 10px auto;}
     #scroll_img{width:590px;overflow:hidden;float:left;*position:relative;border: 1px #ccc solid;}/*可视区域宽度*/
     .scroll_img_list{width:9999px;}
     .scroll_img_list li{float:left;width:140px;margin-right:10px;}/*items*/
     .scroll_img_list li p{text-align:center;}
     .scroll_img_list li p a{text-decoration:none;color:#666;}
     .left_btn,.right_btn{float:left;}
    
    

    希望本文所述对大家的javascript程序设计有所帮助。

    Copyright © 2019- 517ttc.cn 版权所有 赣ICP备2024042791号-8

    违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

    本站由北京市万商天勤律师事务所王兴未律师提供法律服务