Javascript 向左滚动不';当使用空白时,不能在IE和Firefox上工作:nowrap

Javascript 向左滚动不';当使用空白时,不能在IE和Firefox上工作:nowrap,javascript,html,css,Javascript,Html,Css,我的代码不适用于IE和Firefox,但适用于Chrome: IE和Firefox上的向左滚动值=0,为什么 <body style="direction:rtl"> <div style="width:520px; margin:0 auto; background:#eee; height:120px;overflow:scroll " id="BookSliderContent"> <div style="white-space:nowrap;">

我的代码不适用于IE和Firefox,但适用于Chrome: IE和Firefox上的向左滚动值=0,为什么

<body style="direction:rtl">
<div style="width:520px; margin:0 auto; background:#eee; height:120px;overflow:scroll " id="BookSliderContent">
    <div style="white-space:nowrap;">
        <div style="width:100px;height:100px; background-color:lightblue;margin:20px;display:inline-block">1</div>
        <div style="width:100px;height:100px; background-color:lightblue;margin:20px;display:inline-block">2</div>
        <div style="width:100px;height:100px; background-color:lightblue;margin:20px;display:inline-block">3</div>
        <div style="width:100px; height:100px; background-color:lightblue; margin:20px; display:inline-block">4</div>
        <div style="width:100px;height:100px; background-color:lightblue; margin:20px; display:inline-block;">5</div>
    </div>
</div>

<script type="text/javascript">
  var  ScrollLeft = 0;
  ScrollLeft = document.getElementById("BookSliderContent").scrollLeft;
  alert(ScrollLeft);
</script>

1.
2.
3.
4.
5.
var左=0;
ScrollLeft=document.getElementById(“BookSliderContent”).ScrollLeft;
警报(向左滚动);

看起来其他人也有同样的问题:看起来其他人也有同样的问题: