JQ动画,背景透明度

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script src="../Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $("#panel").toggle(function () {
                $(this).fadeOut();
            }, function () {
                $(this).fadeIn();
            });
        });
        $(function () {
            $("#btnShow").click(function () {
                $("#panel").fadeIn();
            });
            $("#btnHide").click(function () {
                $("#panel").fadeOut();
            });



            //***************************
            $("#btnSlideup").click(function () {
                $("#div1").slideUp();
            });
            $("#btnslideDown").click(function () {
                $("#div1").slideDown();
            });

        });
    </script>
</head>
<body>
    <div id="panel">
        sdfsldfjlksjalkfjdlsakjflksjadlfkjasldkjflksdaf</div>
    <input type="button" value="透明度显示" id="btnShow" />
    <input type="button" value="透明度隐藏" id="btnHide" />
    <br />
    <div id="div1">
        阿来的快放假了卡斯的减肥拉开斯蒂芬</div>
    <input type="button" value="垂直显示" id="btnSlideup" />
    <input type="button" value="垂直隐藏" id="btnslideDown" />
</body>
</html>

 

posted @ 2014-05-21 21:36  编程猴子  阅读(614)  评论(0编辑  收藏  举报