zoukankan      html  css  js  c++  java
  • jquery超级简单的后台系统自适应框架

    系统后台自适应简单框架

    <!DOCTYPE HTML>
    <html lang="zh-CN">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>系统后台自适应简单框架</title>
    <script type="text/javascript" src="jquery-1.8.2.min.js"></script>
    <style type="text/css">
        html { *background-image:url(about:blank); *background-attachment:fixed;border: none; margin: 0px; padding: 0px;}
        body{ font-size: 12px; width: 100%;margin: 0px; padding: 0px;}
        /*清除浮动 S*/
        .clearfix { #zoom:1; }
        .clearfix:after { content:'.'; height:0; line-height:0; display:block; clear:both; visibility:hidden; }
        /*清除浮动 E*/
        #header{ width: 100%; min-height: 100px; background:  #ececec; background-color: #ececec;}
        #center{ width: 100%;min-height: 300px; position: relative; margin: 10px auto; }
        #center .leftCom{ width: 200px;  position: absolute; left: 0; border: 1px solid #ddd; border-left: 0 none; min-height: 300px; z-index: 1;}
        #center .leftColseOpen{ position: absolute;z-index: 2;cursor: pointer;}
        #center .rightCom{ width: 100%;position: absolute;border: 1px solid #f00;right: 10px; min-height: 300px; }
        #footer{ width: 100%;min-height: 50px;background-color: #f60; position: fixed; bottom: 0;}
    </style>
    
    </head>
    
    <body>
    <div id="header"></div>
    <div id="center" class="clearfix">
        <div class="leftCom"></div>
        <div class="leftColseOpen">关闭</div>
        <div class="rightCom"></div>
    </div>
    <div id="footer"></div>
    
    <script type="text/javascript">
        var main=(function(){
            function windFun(){
                var widH=$(window).height(),
                headH=$("#header").height(),
                footH=$("#footer").height(),
                mainH=widH-headH-footH-20,
                widW=$(window).width(),
                leftW=$(".leftCom").width(),
                mainW=widW-leftW-30;
                $(".leftCom,.rightCom").css("height",mainH);
                $(".rightCom").css({"width":mainW,"left":leftW+10});
                $(".leftColseOpen").css({"top":mainH/2,"left":leftW});
            }
            function colseOpenClick(){
                $(".leftColseOpen").toggle(function(){
                    $(".leftCom").css({"display":"none","width":0});
                    $(this).text("打开");
                    windFun();
                },function(){
                    $(".leftCom").css({"display":"block","width":200});
                    $(this).text("关闭");
                    windFun();
                })
            }
            return{
                windFunm:function(){windFun();},
                colseOpenClickn:function(){colseOpenClick();}
            }
        })();
    
        $(function(){
            main.windFunm();
            $(window).resize(function(){
                main.windFunm();
            })
            main.colseOpenClickn();
        })
    </script>
    </body>
    </html>
  • 相关阅读:
    java笔记之输入输出流
    英文单词个数统计及排序
    课后作业_程序员修炼之道读后感
    第五周-内网穿透简易搭建(远程查看javaweb程序)
    第五周总结
    结对开发
    第四周学习总结
    第四周--爬虫的学习
    第四周学习总结
    第三周---------学习动态规划
  • 原文地址:https://www.cnblogs.com/boyzi/p/4091442.html
Copyright © 2011-2022 走看看