zoukankan      html  css  js  c++  java
  • 对Iframe和图表设置高度的优质代码

     1 //对Iframe和图表设置高度
     2     function f() {
     3         parent.window.setWinHeight(parent.window.document.getElementById("frame_${queryCategory}"));
     4     }
     5     var win_height, interval, cnt = 0;
     6     function dif() {
     7         var cur_height = document.body.offsetHeight;
     8         if (cur_height != win_height || cnt > 10) {
     9             clearInterval(interval);
    10             f();
    11         }
    12         cnt++;
    13     }
    14     var myview = $.extend({},$.fn.datagrid.defaults.view,{
    15         onBeforeRender:function(target){
    16             win_height = document.body.offsetHeight;
    17             interval = setInterval("dif()",1000);
    18         }
    19     });
        // 图表转换方法:用于切换图与表。
        var init = false;
        function toggle(){
            if ($("#container").is(":hidden")) {
                $("#container").show();
                $("#refshbtn").show();
                $("#prm_div").show();
                $("#report_ui").hide();
                $("#tb").hide();
                updateChartData();
                f();
            }else {
                $("#container").hide();
                $("#refshbtn").hide();
                $("#prm_div").hide();
                $("#report_ui").show();
                $("#tb").show();
                if (!init) {
                    $('#tt').datagrid({view:myview,rownumbers:true,
                        singleSelect:true,
                        toolbar: '#tb',
                        onClickRow: onClickRow});
                    init = true;
                }
                $("#tt").datagrid('resize', {
                     $(document.body)[0].clientWidth
                });
                f();
            }
        }
    _____________________________________________________________________________________________________ ***************************************************************************************************************** ===坚持、奋斗***今天的努力只为更好的明天***奋斗、坚持===********************** ==========================================================================================
  • 相关阅读:
    数据处理——时间数据处理
    数据处理——异常值检测
    数据处理——缺失值处理
    数据分析——数据校验
    Python之Pandas知识点
    Python基础知识之疑点难点
    Python习题(第3课)
    跳一跳小外挂(附完整代码)
    《软件工程》实训报告
    用户使用手册与测试报告(团队作业)
  • 原文地址:https://www.cnblogs.com/mlloc-clove/p/3880944.html
Copyright © 2011-2022 走看看