弹出层适合用fadeIn和fadeOut,简单又好看

解决方案 »

  1.   

    固定bottom的值,设置height<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
    <style>
    #pop{position:absolute;left:400px;width:300px;bottom:200px;border:solid 1px black;display:none;}
    </style>
    <script>
        var height = 200;
        function show() {
            if ($('#pop').is(':visible')) $('#pop').animate({ height: 0 }, 300, function () { $('#pop').hide() });
            else $('#pop').show().animate({ height: 200 }, 300);
        }
    </script>
    <div id="pop"></div>
    <input type="button" value="SHOW" onclick="show()" />
      

  2.   


    那向上展开的有思路没
    先设置容器高度为0,overflow:hidden,目标margin-top为其高度*-1,
    然后增加容器高度同时增加margin-top,增加数值相同,直至margin-top为0,这样就会有向上展开效果
      

  3.   


    那向上展开的有思路没
    先设置容器高度为0,overflow:hidden,目标margin-top为其高度*-1,
    然后增加容器高度同时增加margin-top,增加数值相同,直至margin-top为0,这样就会有向上展开效果thanks  我用上面那位的实现了   
      

  4.   


    那向上展开的有思路没
    先设置容器高度为0,overflow:hidden,目标margin-top为其高度*-1,
    然后增加容器高度同时增加margin-top,增加数值相同,直至margin-top为0,这样就会有向上展开效果不是margin-bottom么 
      

  5.   


    还有jq如何去除style里边一个特性的属性?  
      

  6.   

    设置为默认值,去边框就设置border为none之类的
      

  7.   


    css('top','')   这样?
      

  8.   


    css('top','')   这样?对