jQuery 滑动打开主要的三个部分

<!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="../jquery132min.js" type="text/javascript"></script>

    <script type="text/javascript">
        var w = $(window).width() - 22;
        var h = $(window).height() + 200;
        w = window.screen.availWidth - 24;
        h = window.screen.availHeight;
        $(function() {
            $("body").css({ overflowX: "hidden" });
            $("#TopDiv").css({ width: w, height: "180px", border: "1px #CCCCFF solid", left: "1px", top: "-180px", position: "absolute", float: "left" });
            $("#LeftDiv").css({ width: "200px", height: h - 186, border: "1px #CCCCFF solid", left: "-200px", top: "180px", marginTop: "6px", position: "absolute", float: "left" });
            $("#MainDiv").css({ width: w - 206, height: h - 186, border: "1px #CCCCFF solid", left: w, top: "180px", marginTop: "6px", marginLeft: "6px", position: "absolute", float: "left" });

            $("#TopDiv").animate({ top: "1px" }, 1000, function() { });
            $("#LeftDiv").animate({ left: "1px" }, 1000, function() { });
            $("#MainDiv").animate({ left: "201px" }, 1000, function() { $("body").css({ overflowX: "" }); });
        });
        function openUrl(obj) {
            $("#iframeMian").attr("src", obj.lang);
        }
    </script>

</head>
<body style="margin: 0px 0px;">
    <div id="TopDiv">
    </div>
    <div id="LeftDiv">
        <a href="javascript:;" onclick="openUrl(this)" lang="http://www.baidu.com">baidu</a>
    </div>
    <div id="MainDiv">
        <iframe id="iframeMian" width="100%" src="" frameborder="0" height="100%"></iframe>
    </div>
</body>
</html>

posted @ 2011-10-18 11:27  ajunfly  阅读(623)  评论(0编辑  收藏  举报