我在div上设置了滚动条
<div id="content" style=" overflow-y:auto;verflow-x:hidden;">内容</div>
当内容大于div高度时候滚动条会显示谁会用js 或 jquery 用鼠标来控制 鼠标移动到div上 滚动条显示   移开滚动条隐藏啊  

解决方案 »

  1.   

    var d = document.getElementById('content');
    d.onmouseover = function(){this.style.overflowX = 'auto'};
    d.onmouseout = function(){this.style.overflowX = 'hidden'};
      

  2.   


    $("#content").hover(
        function(){
            $(this).css("overflow-y","scroll");
        },function(){
            $(this).css("overflow-y","hidden");
        }
    );
      

  3.   

    利用style.overflowX属性
    jquery当然可以直接通过css()赋值!!!