http://yw.zxxk.com/softList.aspx?ClassID=614&ChapterID=408&NodeID=1584
这个页面上的内容简介JS
根据DIV的高度自动判断超过180PX自动overflow:hidden 并且超过180PX的DIV 鼠标划过滚动条出现

解决方案 »

  1.   

    意思是放上去有滚动条吗?http://www.google.com.hk/search?hl=zh-CN&source=hp&q=js+%E5%8A%A8%E6%80%81%E6%98%BE%E7%A4%BA%E6%BB%9A%E5%8A%A8%E6%9D%A1&aq=f&aqi=&aql=&oq=&gs_rfai=
      

  2.   

    http://www.cnblogs.com/DennisChen/archive/2009/08/07/1541409.html
    或者看看这个,下面的评论比较有用
      

  3.   


      <script type="text/javascript">
            $(function() {
                var div1 = $("#div1");
                div1.hover(function() {
                    if (parseInt(div1.css("height")) >= 100) {
                        var _this = $(this);
                        _this.css("height", 100).css("overflowY", "scroll");
                    }
                }, function() {
                    var _this = $(this);
                    _this.css("height", 100).css("overflowY", "hidden");
                });
            });
        </script>用jq写了下。不知道是不是要这样的效果
      

  4.   

    <div id="div1" style="height:100px; overflow:hidden;"><ul>
           <%for (int i = 0; i < 100; i++) { 
               %>
                <li><%=i.ToString() %></li>
               <%
             } %>
             </ul>
        </div>function pageLoad()
         {
             var div1=document.getElementById("div1");
             div1.onmousemove=function(){
                if(parseInt(div1.style.height)>=100)
                {
                  div1.style.height="100px";
                  div1.style.overflowY="scroll";
                }
             }
             div1.onmouseout=function(){
                 div1.style.height="100px";
                 div1.style.overflowY="hidden";
             }
         }#7的是用JQ做的
      

  5.   

    function formatIntro(){
    $("div.item_intro").each(
     function(){if(this.offsetHeight>180){
    this.style.height="180px";this.style.overflow="hidden"}});
    $("div.item_intro").mouseover(
    function(){$(this).css("overflow","auto")});
    $("div.item_intro").mouseout(function(){$(this).css("overflow","hidden")})}
      

  6.   

    我自己解决了 晕
    <script type="text/javascript">
    var div1=document.getElementById("div1");
    if(parseInt(div1.offsetHeight)>=100)
      {
      div1.style.height="100px"; 
      div1.onmouseover=function(){
      div1.style.overflow="auto";
      }
      div1.onmouseout=function(){
      div1.style.overflow="hidden";
      }
      }
    </script>