PHP 应用程序中的选项卡 - 融合图表

Tabs in PHP Application - Fusion Charts

本文关键字:融合 选项 应用程序 PHP      更新时间:2023-09-26

如何显示选项卡内容加载时请稍候或进度轮。

当我单击选项卡"当前状态"时,它将加载" dashboard_sla.php "具有融合图表。当图表正在加载时,我想显示进度轮或请稍候。

请找到我的代码

<?php
if($status == AUTH_LOGGED){
    ?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Dashboard</title>
<style>
#tabs{
    padding-right:20px;    /* The right most tab will be padded 20px from its right */
    margin:0px;
    float:right;        /* For right aligned tabs */
}
#tabs a{
    background:#000 url(images/left_tab.gif) top left no-repeat;    /* Background image is positioned top, left */
    color:#FFF;
    padding-left:5px;    /* Change this padding according to the size of image slices used to create tab */
    text-decoration:none;
}
#tabs a:hover{
    background:#EDCB27 url(images/selected_left_tab.gif) top left no-repeat;
    color:#000;
    text-decoration:none;
}
#tabs a span{
    background:#000 url(images/right_tab.gif) top right no-repeat;    /* Note the position of background image */
    color:#FFF;
    padding-right:15px;
}
#tabs a:hover span{
    background:#EDCB27 url(images/selected_right_tab.gif) top right no-repeat;
    color:#000;
}
#tabs li{
    list-style:none;
    float:left;
    padding-left:3px;
}
#tabs b{
    background:#EDCB27 url(images/selected_left_tab.gif) top left no-repeat;
    color:#FFF;
    padding-left:5px;
    font-weight:normal;
}
#tabs b span{
    background:#EDCB27 url(images/selected_right_tab.gif) top right no-repeat;
    color:#000;
    padding-right:15px;
}
#tabs span{
    font-family:Arial, Helvetica, sans-serif;
    font-size:12px;
    padding:6px;
    cursor:pointer;
}
#tabs a,#tabs a span,#tabs b,#tabs b span{
    display:block;        /* Set display to block, otherwise background images will not work*/
    float:left;
}
</style>
</head>
<body>
 <?php
    $tab=$_REQUEST['tab'];
    if($tab=='') $tab='Dashboard1';
?>
    <ul id="tabs">
        <?php if($tab=='Dashboard1'){ ?>
        <li><b><span>Current Status</span></b></li>
        <?php }else{ ?>
        <li><a href="?tab=Dashboard1"><span>Current Status</span></a></li>
        <?php } ?>
        <?php if($tab=='Dashboard2'){ ?>
        <li><b><span>SLA Trend IT</span></b></li>
        <?php }else{ ?>
        <li><a href="?tab=Dashboard2"><span>SLA Trend IT</span></a></li>
        <?php } ?>

    </ul>
<div style="clear:both; background-color:#FFFFFF; height:0px; overflow:hidden"></div>
    <div style="border:solid 3px #FFFFFF; background-color:#FFFFFF; padding:10px; font-family:Verdana, Geneva, sans-serif; font-size:11px;">
<?php if($tab=='Dashboard1'){
     include('dashboard_sla.php');
     } else if($tab=='Dashboard2'){
        include('dashboard_sla6.php');
     } 

}
else{
echo "<center>You must log in First</center>";
echo "</td>";
echo "<td style='padding:0 0 0 28px;' valign=top>";
echo "<iframe frameborder=0 width=100% name=mainf scrolling=auto src=dashboard.php marginwidth=0 marginheight=0 style=margin:0px; padding:0px; height=600></iframe>";
echo "</td></tr></table>";
echo "  </div>'n";
echo "</div>'n";
echo "'n";
} ?>

</div>
</body>
</html>

单击选项卡时添加 jquery 进度条。 添加 jquery UI 插件。

<script>
$(function() {
$( "#progressbar" ).progressbar({
});
});
</script>

另一个选项是您可以添加"加载器"。添加加载程序映像。

<div id="loader">
<img src="loader.gif" alt="" />
</div>

之后,当您单击一个选项卡时,编写代码,

$('#loader').show();