码迷,mamicode.com
首页 > 其他好文 > 详细

对Iframe和图表设置高度的优质代码

时间:2014-07-31 16:48:56      阅读:152      评论:0      收藏:0      [点我收藏+]

标签:style   blog   color   strong   io   for   art   cti   

 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‘, {
                width: $(document.body)[0].clientWidth
            });
            f();
        }
    }

 

对Iframe和图表设置高度的优质代码,布布扣,bubuko.com

对Iframe和图表设置高度的优质代码

标签:style   blog   color   strong   io   for   art   cti   

原文地址:http://www.cnblogs.com/mlloc-clove/p/3880944.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!