• 手机版

    扫码体验手机版

  • 微信公众号

    扫码关注公众号

国内首家协议开发

软芯音视解码保护平台

在线
客服

发布
需求

在线
聊天

天盟
APP

天盟APP下载

关注
微信

微信扫一扫访问
顶部

为什么这里的offsetLeft和style.left不一样????

* { margin: 0px; padding: 0px; text-decoration: none;}#container {  overflow: hidden; margin: 50px auto; width: 550px; height: 321px; border: 4px solid #ccc; position: relative;}#imgList { position: absolute; width: 800%; height: 100%;}#imgList img { float: left;}#buttonList { position: absolute; margin: auto;  right: 0; left: 0; bottom: 30px; height: 10px; width: 125px;}#buttonList span { margin: 0 4px; height: 15px; width: 15px; float: left; text-indent: -9999px; cursor: pointer; border: 1px solid #fff; border-radius: 50%; background-color: #333;}.arrow { position: absolute; display: none; z-index: 10; top: 180px; line-height: 39px; font-size: 39px; font-weight: bold; width: 40px; height: 39px; text-align: center; background-color: RGBA(0,0,0,.3); color: #fff;}#prev { left: 10px;}        #next { right: 10px;}#container:hover .arrow { display: block;}.arrow:hover { background-color: RGBA(0,0,0,.7);}                       
               
               
               
               
               
               
       
                        1                2                3                4                5               
        <        >
       
203006dxgzi8eggo4dedpa.jpg

203007pj48xoyggx5ggc2j.jpg

免责声明:本内容仅代表回答会员见解不代表天盟观点,请谨慎对待。

版权声明:作者保留权利,不代表天盟立场。

使用道具 举报

全部参与1

offsetLeft是要算所有(本身和父元素)的边框,#container有个border:4px,所以计算#imgList的offsetLeft的时候会加上这4px

使用道具 举报

发新帖

发布任务需求已有1031167位用户正在使用天盟网服务

发布分类: *
任务预算: *
需求内容: *
手机号码: *
任务商家报价为
  • 预算价 :
  • 成交价 :
  • 完工期 :
  • 质保期 :

* 最终任务项目以服务商报价、双方协商为准!