通行证: 用户 密码 域名空间  下载中心 社区论坛 信息公告 MY小屋
联系我们
设为首页
加入收藏

 

QQ,ASP,PHP,JSP,XML,SQL,.Net,编程 程序 网页图象 建站经验 私服
首页 | 新闻资讯 | 编程开发 | 网页设计 | 图形图象 | 网络媒体 | 网站模板 | 数 据 库 | 投稿
论坛 | 操作系统 | 系统优化 | 网络安全 | 黑客技术 | 硬件学堂 | 硬件报价 | 服 务 器 | 地图
专题 | 应用软件 | 聊天通讯 | Q Q 专栏 | 建站经验 | 在线工具 | 站长Club | 注 册 表 | 旧版
社会 | 游戏娱乐 | 设计欣赏 | 疑难解答 | 社区论坛 | 韩国素材 | 素材图库 | 广告服务 | 服务
当前位置:首页>>编程开发>>PHP专区>>正文 新版上线![旧版]
注:打开慢时请稍等

仿OfficeXP风格的左边版面列表

http://www.iyit.net  日期:2006-5-25 10:32:11  来源:本站整理转载   点击:
参加讨论


<?php
/**
* 仿OfficeXP风格的左边版面列表
* --------------------------------------------------------------------------------
* blood 于 2/19/2002 4:47:11 PM 加贴在 Visual Basic
*
* 徐祖宁(唠叨) 移植于 3/2/2002
* OOP 版
*
*/

class Frame {
function run() {
global $PHP_SELF;
echo <<<EOD
<HTML>
<HEAD>
<TITLE>Menu Sample</TITLE>
<SCRIPT LANGUAGE="JavaScript">
if (window != top) top.location.href = location.href;
</SCRIPT>
</HEAD>
<FRAMESET cols="161,*">
<FRAME MARGINWIDTH="0" SRC="$PHP_SELF?key=menu" NAME="menu" SCROLLING=no NORESIZE>
<FRAME MARGINWIDTH="0" SRC="$PHP_SELF?key=about" NAME="main" scrolling=auto NORESIZE>
</FRAMESET>
</HTML>
EOD;
}
}

class About {
function run() {
echo <<<EOD
<style>
body { font-size: 9pt; font-family:"Verdana", "Arial", "宋体"; }
</style>
<body>
<center>
<br>
<br>
关于此菜单
<br>
<br>
说明,此菜单程序只能使用在IE 5以上的版本使用,NetSpace下不能使用,推荐使用IE 6正式中文版
</center>
</body>
EOD;
}
}

class Page {
function run($id1) {
global $id;
echo <<<EOD
<style>
body { font-size: 9pt; font-family:"Verdana", "Arial", "宋体"; }
</style>
<body>
<center>
<br>
<br>
欢迎访问 $id
</center>
</body>
EOD;
}
}

class Menu {
var $MenuOn = 0; //定义分类菜单数目
var $MenuBackColor = "lightgrey"; //定义分类菜单背景颜色
var $MenuFontSize = "9pt"; //定义分类菜单字体
var $MenuBarHeight = 20; //定义分类菜单高度
var $ItemTextColor = "#000000"; //定义分类菜单项目文字颜色
var $ItemBackColor = "lightgrey"; //定义分类菜单项目背景颜色
var $TopMenuHeight = 0; //定义分类菜单与顶部的间距
var $SelectedItemDarkBorder = "#08246B"; //定义分类菜单项目在鼠标移动到上面时的暗边框颜色
var $SelectedItemLightBorder = "#08246B"; //定义分类菜单项目在鼠标移动到上面时的亮边框颜色
var $SelectedItemBackgroundColor = "#B5BED6"; //定义分类菜单项目在鼠标移动到上面时的背景颜色
var $menuSubSectionBackColor = "darkgray"; //定义二级菜单背景颜色
var $menuSubSectionFontColor = "black"; //定义二级菜单菜单字体颜色
var $defTarget = "main"; //定义菜单项目超连接默认目标框架

/**
* menuStartSection($Seq, $Label)
* 制作分类菜单
* $Seq = 分类菜单序列号,使用菜单序列号控制启动是显示顺序
* $Label = 分类菜单标题
*/
function menuStartSection($SectionSeq, $SectionName) {
$menuBackColor = $this->menuBackColor;
$MenuBarHeight = $this->MenuBarHeight;
$MenuFontSize = $this->MenuFontSize;
$menuSection = $this->menuSection;
$ItemBackColor = $this->ItemBackColor;
$mh = $this->MenuBarHeight-2;
echo <<<EOD

<table bgcolor="$menuBackColo" border=0 cellspacing=0 cellpadding=0 width="100%" height="1">
<tr height="1">
<td bgcolor="white"></td>
</tr>
</table>
<table bgcolor="$menuBackColor" border=1 cellspacing=0 cellpadding=0 bordercolor="$menuBackColor" width="100%" height="$mh">
<tr vAlign="center" height="100%">
<td nowrap border=3 width="100%" height="100%" bordercolordark=lightgrey bordercolorlight=lightgrey align=center style="cursor:hand;" title="$SectionName" onmouseover="status=’$SectionName’;" onmouseout="status=’’;" onclick="StartSection(menuSection$SectionSeq);">$SectionName</td>
</tr>
</table>
<table border=0 cellspacing=0 cellpadding=0 width="100%" height="1">
<tr height="1">
<td bgcolor="Black"></td>
</tr>
</table>
<div name=menuSection$SectionSeq id=menuSection$SectionSeq style="display:’none’;overflow:hidden; height:1px;marginRight:0px;">
<table bgcolor=$ItemBackColor style="marginRight=0px;" border=1 cellspacing=0 cellpadding=0 bordercolor="$ItemBackColor" width="100%">
EOD;
}

/**
* menuAddItem($Label, $Description, $URL, $Target="")
* 制作菜单项目
* $Label = 项目标题
* $Description = 项目简介
* $URL = 超连接地址
* $Target = 超连接目标框架,默认为$defTarget
*/
function menuAddItem($itemLabel, $StatusText, $URL, $target="") {
$SelectedItemDarkBorder = $this->SelectedItemDarkBorder;
$SelectedItemLightBorder = $this->SelectedItemLightBorder;
$SelectedItemBackgroundColor = $this->SelectedItemBackgroundColor;
$ItemTextColor = $this->ItemTextColor;

if($target == "") $target = $this->defTarget;
$URL = $this->buildURL($URL);
echo <<<EOD

<tr>
<td width="100%" align=left style="cursor:hand;" title="$StatusText" onmouseover="this.borderColorDark=’$SelectedItemDarkBorder’;this.borderColorLight=’$SelectedItemLightBorder’
;this.style.backgroundColor=’$SelectedItemBackgroundColor’;this.style.color=’black’;status=’$StatusText’;" onmouseout="this.borderColorDark=’’;this.borderColorLight=’’;this.style.backgroundColor=’’;status=’’;" onclick="window.open(’$URL’,’$target’);"><font color="$ItemTextColor">$itemLabel</font></td>
</tr>
EOD;
}

/**
* menuAddSubSection($Label)
* 制作二级分类菜单。
* $Label = 二级分类菜单标题
*/
function menuAddSubSection($ItemLabel) {
$menuSubSectionBackColor = $this->menuSubSectionBackColor;
$menuSubSectionFontColor = $this->menuSubSectionFontColor;
echo <<<EOD

<tr bgcolor="$menuSubSectionBackColor">
<td align=center width="100%"><font color="$menuSubSectionFontColor">$ItemLabel</font></td>
</tr>
EOD;
}

/**
* menuAddSubSectionLine()
* 制作项目分割线,使用高度为2的图片
*/
function menuAddSubSectionLine() {
echo <<<EOD

<tr vAlign="center">
<td align=center width="100%" height="2" bgcolor="white">
<table border=0 cellspacing=0 cellpadding=0 width="100%" height="1">
<tr vAlign="center" height="2">
<td bgcolor="white"></td>
</tr>
</table>
</td>
</tr>
EOD;
}

/**
* menuEndSection()
* 分类菜单结束
*/
function menuEndSection() {
echo <<<EOD

</table>
</div>
EOD;
}

/**
* menuSectionAsItem($Label, $Description, $URL, $Target="")
* 制作带超连接的分类菜单,类似菜单项目,可以直接使用
* $Label = 分类菜单标题
* $Description = 分类菜单简介
* $URL = 超连接地址
* $Target = 超连接目标框架,默认为$defTarget
*/
function menuSectionAsItem($SectionSeq, $SectionName, $SectionDesc, $URL, $target="") {
$menuBackColor = $this->menuBackColor;
$MenuBarHeight = $this->MenuBarHeight;

if($target == "") $target = $this->defTarget;
$URL = $this->buildURL($URL);
$mh = $this->MenuBarHeight-2;
echo <<<EOD

<table border=0 cellspacing=0 cellpadding=0 width="100%" height="1">
<tr vAlign="center" height="1">
<td bgcolor="white"></td>
</tr>
</table>
<table bgcolor="$menuBackColor" border=1 cellspacing=0 cellpadding=0 bordercolor="$menuBackColor" width="100%" height="Smh">
<tr height="100%" vAlign="center">
<td border=3 vAlign="middle" width="100%" height="100%" bordercolordark=lightgrey bordercolorlight=lightgrey align=center
style="cursor:hand;" title="$SectionDesc" onmouseover="status=’$SectionDesc’;" onmouseout="status=’’
;" onclick="window.open(’$URL’,’$target’);"><font color="#000000">$SectionName</font></td>
</tr>
</table>
<table border=0 cellspacing=0 cellpadding=0 width="100%" height="1">
<tr height="1">
<td bgcolor="Black"></td>
</tr>
</table>
EOD;
}

/**
* 将超连接中的空格替换为+号
*/
function buildURL($inURL) {
return str_replace(" ","+",$inURL);
}
/**
* 输出javascript脚本
*/
function scriptOut() {
$dh = $this->TopMenuHeight+($this->MenuBarHeight * $this->menuOn);
echo <<<EOD

<script language=javascript>
var AvailHeight // 定义可利用的高度
var LastSection // 定义将要打开的菜单关闭
var ThisSection // 定义当前需要打开的菜单
var timerDelay=15 // 定义并设置延时
var menuActive=false // 测定当前活动的菜单
var VisibleHeight // 定义显示高度,确定是否显示滚动条
var AniRatio // 定义菜单显示滑动的速度

function getSizing() {
// 菜单打开时得到的可利用的高度
AvailHeight=document.body.clientHeight-$dh
if(AvailHeight<=0) {
LastSection.style.display=’none’;
}else {
// 改变菜单显示滑动速度的比率
AniRatio=0.75; // 设定速度
if (AvailHeight>200) {AniRatio=0.667;}
if (AvailHeight>500) {AniRatio=0.5;} // 根据可利用高度调整速度
LastSection.style.height=AvailHeight;
LastSection.style.overflow=’visible’;
LastSection.style.display=’’;
VisibleHeight=parseInt(LastSection.clientHeight);
if (VisibleHeight>AvailHeight) {LastSection.style.overflow=’auto’;}else{LastSection.style.overflow=’hidden’;};
}
}

function slideMenu() {
// 菜单滑动函数
if(parseInt(LastSection.style.height)>1) {
LastSection.style.height=parseInt(parseInt(LastSection.style.height)*AniRatio);
ThisSection.style.height=AvailHeight-parseInt(LastSection.style.height);
var movetimer=setTimeout("slideMenu()",timerDelay) ;
}else {
// 完成菜单滑动,显示新打开的菜单,隐藏前面以打开的菜单
LastSection.style.display=’none’;
ThisSection.style.height=AvailHeight;
menuActive=false;
if (VisibleHeight>AvailHeight) {ThisSection.style.overflow=’auto’;};
ThisSection.style.marginRight=0;
LastSection=ThisSection;
clearTimeout(movetimer);
}
}

function StartSection(theSection) {
// 开始滑动菜单,检测是否对菜单进行单击
if(menuActive==false) {
if(LastSection!=theSection) {
menuActive=true;
ThisSection=theSection;
LastSection.style.overflow=’hidden’;
ThisSection.style.overflow=’visible’;
ThisSection.style.display=’’;
VisibleHeight=parseInt(ThisSection.clientHeight);
ThisSection.style.overflow=’hidden’;
ThisSection.style.display=’none’;
ThisSection.style.height=1;
LastSection.style.height=AvailHeight-1;
LastSection.style.display=’’;
ThisSection.style.display=’’;
slideMenu()
}
}
}

window.onresize=getSizing
// 启动时打开默认的序号为第一个的菜单
LastSection=document.all.menuSection1;
LastSection.style.display=’’;
getSizing();
</script>
EOD;
}

function run() {
global $PHP_SELF;
$MenuFontSize = $this->MenuFontSize;
$MenuBackColor = $this->MenuBackColor;
echo <<<EOD
<style>
td { font-size: $MenuFontSize; font-family:"Verdana", "Arial", "宋体"; }
</style>
<body leftmargin=0 topmargin=0 rightmargin=0 bgcolor="$MenuBackColor">
EOD;

/**
* 创建菜单
*/
$this->menuStartSection(2, "代码世界");
$this->menuAddItem("Joy ASP", "欢迎访问Joy ASP", "$PHP_SELF?key=page&id=Joy ASP");
$this->menuAddItem("Java 世界", "欢迎访问Java 世界", "$PHP_SELF?key=page&id=Java 世界");
$this->menuAddItem("DotNet 时代", "欢迎访问DotNet 时代", "$PHP_SELF?key=page&id=DotNet 时代");
$this->menuAddItem("Visual Basic", "欢迎访问Visual Basic", "$PHP_SELF?key=page&id=Visual Basic");
$this->menuAddItem("Delphi", "欢迎访问Delphi", "$PHP_SELF?key=page&id=Delphi");
$this->menuEndSection();

$this->menuStartSection(3, "开心一刻");
$this->menuAddItem("传统笑话", "传统笑话", "$PHP_SELF?key=page&id=传统笑话");
$this->menuAddItem("近代笑话", "近代笑话", "$PHP_SELF?key=page&id=近代笑话");
$this->menuAddSubSection("儿童类");
$this->menuAddItem("校园笑话", "校园笑话", "$PHP_SELF?key=page&id=校园笑话");
$this->menuAddItem("幼儿笑话", "幼儿笑话", "$PHP_SELF?key=page&id=幼儿笑话");
$this->menuAddItem("少年笑话", "少年笑话", "$PHP_SELF?key=page&id=少年笑话");
$this->menuAddSubSectionLine();
$this->menuAddItem("中学时代笑话", "中学时代笑话", "$PHP_SELF?key=page&id=中学时代笑话");
$this->menuAddSubSection("成人笑话");
$this->menuAddItem("带颜色的笑话", "带颜色的笑话", "$PHP_SELF?key=page&id=带颜色的笑话");
$this->menuAddItem("笑话林", "笑话林", "$PHP_SELF?key=page&id=笑话林");
$this->menuEndSection();

$this->menuSectionAsItem(3, "菜单简介", "菜单简介", "$PHP_SELF?key=about");

$this->menuStartSection(1, "个人收藏夹");
$this->menuAddItem("DotNet 时代", "欢迎访问DotNet 时代", "$PHP_SELF?key=page&id=DotNet 时代");
$this->menuEndSection();

// 将个人收藏夹定为启动菜单
$this->menuOn = 4;
$this->scriptOut();
echo "</body>n";
}
}

class Application {
var $frame;
var $menu;
var $page;
var $about;
function Application() {
$this->frame = new Frame;
$this->about = new About;
$this->page = new Page;
$this->menu = new Menu;
}
function run($key,$id="") {
switch($key) {
case "menu":
$this->menu->run();
break;
case "page":
$this->page->run($id);
break;
case "about":
$this->about->run();
break;
default:
$this->frame->run();
}
}
}
?>
<?php
/** 运行 **/
$app = new Application;
$app->run($key,$id);
?>


编辑:黑鹰 [发送给好友] [打印本页] [关闭窗口] [返回顶部]
上一篇:用PHP实现POP3邮件的收取
下一篇:聊天室技术-处理异常离线的方法
转载请注明来源:www.iyit.net
特别声明: 本站除部分特别声明禁止转载的专稿外的其他文章可以自由转载,但请务必注明出处和原始作者。文章版权归文章原始作者所有。对于被本站转载文章的个人和网站,我们表示深深的谢意。如果本站转载的文章有版权问题请联系编辑人员,我们尽快予以更正。

 相关文章
最新更新 热点排行 推荐新闻
初学者必读 PHP常用开发工具分析
最令PHP初学者头痛的十四个问题 
Win2003下APACHE+PHP5+MYSQL4+PHPMYAD
Win2000下PHP服务器安装攻略
在Windows中安装Apache2和PHP4的权威指
更新了本站链接,请各位站长注意!
初学者必读 PHP常用开发工具分析
最令PHP初学者头痛的十四个问题 
Win2003下APACHE+PHP5+MYSQL4+PHPMYAD
Win2000下PHP服务器安装攻略
在Windows中安装Apache2和PHP4的权威指
在WIN平台上让你 Apache 2.0.45支持PH
PHP 在Windows 2003 Enterprise Serve
Zend Optimizer 配置指南
虚拟主机中对PHP的特殊设置
判断字符串emailAddr是否为合法的emai
PHP控制语句 
如何正确理解 PHP 的错误信息
PHP的十个高级技巧 
PHP新手上路(一) 
优秀公益广告作品欣赏(8)
java数据类型转换
Windows XP专业版IIS连接数的更改
新开放QQ免费挂级网站
优秀公益广告作品欣赏(7)
免费在QQ上看在线电影电视听音乐
WEB服务器配置全攻略(三)
QQ珊瑚虫外挂4.0版本发布!
免费把QQ炫铃设为本机QQ的系统提示音
Office2007简体中文版浮出水面 美图抢
如何在Win20003中更好的玩游戏
QQ收费头像免费使用的方法 
微软将在华推分期付款,充值卡PC 可低价
 AMD处理器AM2测试 风扇竟运行7分钟
exeplorer.exe错误的问题的总结、解决
ASP.NET 2.0 中的异步页功能应用
硬盘坏道修复及数据恢复宝典
免费登录搜索引擎入口大全
搜索引擎注册九大秘法
小心摄像头成为黑客偷窥你的眼睛
 友情链接
设置首 页 - 版权声明 - 广告服务 - 关于我们 - 联系我们 - 友情连接
Copyrights © 2004-2006 iYiT.Net All Rights Reserved.
网站合作、广告联系QQ:147007642、466949678
易特网络技术 点击这里给我发消息