后台管理系统界面和样式,点击左边新建标签效果
生活随笔
收集整理的這篇文章主要介紹了
后台管理系统界面和样式,点击左边新建标签效果
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
后臺管理系統(tǒng)界面和樣式,點(diǎn)擊左邊新建標(biāo)簽效果
?
Code<!DOCTYPE?html?PUBLIC?"-//W3C//DTD?XHTML?1.0?Transitional//EN"?"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html?xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta?http-equiv="Content-Type"?content="text/html;?charset=gb2312"?/>
<title>www.lanrentuku.com</title>
<style?type="text/css">
body{font-size:12px;}
ul,li,h2{margin:0;padding:0;}
ul{list-style:none;}
#top{width:900px;height:40px;margin:0?auto;background-color:#CCCC00}
#top?h2{width:150px;height:40px;background-color:#99CC00;float:left;font-size:14px;text-align:center;line-height:40px;}
#topTags{width:750px;height:40px;margin:0?auto;background-color:#CCCC00;float:left}
#topTags?ul?li{float:left;width:100px;height:25px;margin-right:5px;display:block;text-align:center;cursor:pointer;padding-top:15px;}
#main{width:900px;height:500px;margin:0?auto;background-color:#F5F7E6;}
#leftMenu{width:150px;height:500px;background-color:#009900;float:left}
#leftMenu?ul{margin:10px;}
#leftMenu?ul?li{width:130px;height:30px;display:block;background:#99CC00;cursor:pointer;line-height:30px;text-align:center;margin-bottom:5px;}
#leftMenu?ul?li?a{color:#000000;text-decoration:none;}
#content{width:750px;height:500px;float:left}
.content{width:740px;height:490px;display:none;padding:5px;overflow-y:auto;line-height:30px;}
#footer{width:900px;height:30px;margin:0?auto;background-color:#ccc;line-height:30px;text-align:center;}
.content1?{width:740px;height:490px;display:block;padding:5px;overflow-y:auto;line-height:30px;}
</style>
<script?type="text/javascript">
window.onload=function(){
function?$(id){return?document.getElementById(id)}
var?menu=$("topTags").getElementsByTagName("ul")[0];//頂部菜單容器
var?tags=menu.getElementsByTagName("li");//頂部菜單
var?ck=$("leftMenu").getElementsByTagName("ul")[0].getElementsByTagName("li");//左側(cè)菜單
var?j;
//點(diǎn)擊左側(cè)菜單增加新標(biāo)簽
for(i=0;i<ck.length;i++){
ck[i].onclick=function(){
$("welcome").style.display="none"//歡迎內(nèi)容隱藏
//循環(huán)取得當(dāng)前索引
for(j=0;j<8;j++){
if(this==ck[j]){
if($("p"+j)==null){
openNew(j,this.innerHTML);//設(shè)置標(biāo)簽顯示文字
?}
clearStyle();
$("p"+j).style.backgroundColor="yellow";
clearContent();
$("c"+j).style.display="block";
???}
?}
return?false;
??}
?}
//增加或刪除標(biāo)簽
function?openNew(id,name){
var?tagMenu=document.createElement("li");
tagMenu.id="p"+id;
tagMenu.innerHTML=name+"???"+"<img?src='http://www.tjdadi.com.cn/off.gif'?style='vertical-align:middle'/>";
//標(biāo)簽點(diǎn)擊事件
tagMenu.onclick=function(evt){
clearStyle();
tagMenu.style.backgroundColor="yellow";
clearContent();
$("c"+id).style.display="block";
}
//標(biāo)簽內(nèi)關(guān)閉圖片點(diǎn)擊事件
tagMenu.getElementsByTagName("img")[0].onclick=function(evt){
evt=(evt)?evt:((window.event)?window.event:null);
if(evt.stopPropagation){evt.stopPropagation()}?//取消opera和Safari冒泡行為;
this.parentNode.parentNode.removeChild(tagMenu);//刪除當(dāng)前標(biāo)簽
var?color=tagMenu.style.backgroundColor;
//設(shè)置如果關(guān)閉一個標(biāo)簽時,讓最后一個標(biāo)簽得到焦點(diǎn)
if(color=="#ffff00"||color=="yellow"){//區(qū)別瀏覽器對顏色解釋
if(tags.length-1>=0){
clearStyle();
tags[tags.length-1].style.backgroundColor="yellow";
clearContent();
var?cc=tags[tags.length-1].id.split("p");
$("c"+cc[1]).style.display="block";
?}
else{
clearContent();
$("welcome").style.display="block"
???}
??}
}
menu.appendChild(tagMenu);
}
//清除標(biāo)簽樣式
function?clearStyle(){
for(i=0;i<tags.length;i++){
menu.getElementsByTagName("li")[i].style.backgroundColor="#FFCC00";
??}
}
//清除內(nèi)容
function?clearContent(){
for(i=0;i<7;i++){
$("c"+i).style.display="none";
?}
}
}
</script>
</head>
<body>
<div?id="top">
<h2>管理菜單</h2>
<div?id="topTags">
<ul>
</ul>
</div>
</div>
<div?id="main">?
<div?id="leftMenu">
<ul>
<li>個人資料</li>
<li>相冊管理</li>
<li>日志管理</li>
<li>留言管理</li>
<li>風(fēng)格管理</li>
<li>系統(tǒng)管理</li>
<li>幫助信息</li>
</ul>
</div>
<div?id="content">
<div?id="welcome"?class="content"?style="display:block;">
??<div?align="center">
????<p>?</p>
????<p><strong>歡迎使用用戶管理系統(tǒng)!</strong></p>
????<p>?</p>
????</div>
</div>
<div?id="c0"?class="content">個人資料</div>
<div?id="c1"?class="content">相冊管理</div>
<div?id="c2"?class="content">日志管理</div>
<div?id="c3"?class="content">留言管理</div>
<div?id="c4"?class="content">風(fēng)格管理</div>
<div?id="c5"?class="content">系統(tǒng)管理</div>
<div?id="c6"?class="content">幫助信息</div>
</div>
</div>
<div?id="footer">copyright?for?lalasxc?</div>
</body>
</html>
?
來源懶人
轉(zhuǎn)載于:https://www.cnblogs.com/sendling/archive/2008/12/27/1363451.html
總結(jié)
以上是生活随笔為你收集整理的后台管理系统界面和样式,点击左边新建标签效果的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 使用 MSBuild 和 Windows
- 下一篇: flash mini site Part