主要实现效果:

1、点击对话,显示对话;点击联系人,显示联系人

2、在联系人界面:

实现好友列表的展开与折叠;(图12)

实现鼠标移到好友列表上的背景颜色的变化;(图3)

选中的好友背景颜色改变(图4)

代码如下:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style>
#mid{
height:525px;
width:300px;
position: relative;
background-color: greenyellow;
} #menu{
width:300px;
height:30px;
}
.list{ width:75px;
height:30px;
float:left;
text-align:center;
line-height:30px;
vertical-align:middle;
}
.list:hover{
cursor: pointer;
} .zhu{
width: 300px;
height: 30px;
text-align: left;
vertical-align: middle;
line-height: 30px;
}
.zhu:hover{
cursor: pointer;
}
.zi{
width: 300px;
display: none; }
.lb{
height: 30px;
width: 300px; text-align: left;
vertical-align: middle;
line-height: 30px; }
.xm{
margin-left: 30px;
} .nr{
width:300px;
height:495px;
text-align:center;
line-height:200px;
vertical-align:middle;
position: relative;
}
</style>
</head>
<body>
<div id="mid">
<div id="menu">
<div class="list" style="background-color:gold" onclick="Show('d1')">会话</div>
<div class="list" style="background-color:gainsboro" onclick="Show('d2')">联系人</div>
<div class="list" style="background-color:greenyellow" onclick="Show('d3')">群聊</div>
<div class="list" style="background-color:burlywood" onclick="Show('d4')">空间</div>
</div>
<div id="d1" class="nr" style="background-color:gold">
对话
</div> <div id="d2" class="nr" style="background-color:gainsboro; display:none;"> <div class="zhu" onclick="show('a1')">  我的好友</div>
<div class="zi" id="a1">
<div class="lb" onclick="Xuan(this)" xz="0" onmouseover="Bian(this)" onmouseout="Hui(this)"><span class="xm">陈一</span></div>
<div class="lb" onclick="Xuan(this)" xz="0" onmouseover="Bian(this)" onmouseout="Hui(this)"><span class="xm">王二</span></div>
</div>
<div class="zhu" onclick="show('a2')">  特别关注</div>
<div class="zi" id="a2">
<div class="lb" onclick="Xuan(this)" xz="0" onmouseover="Bian(this)" onmouseout="Hui(this)"><span class="xm">张三</span></div>
<div class="lb" onclick="Xuan(this)" xz="0" onmouseover="Bian(this)" onmouseout="Hui(this)"><span class="xm">李四</span></div>
</div>
<div class="zhu" onclick="show('a3')">  陌生人</div>
<div class="zi" id="a3">
<div class="lb" onclick="Xuan(this)" xz="0" onmouseover="Bian(this)" onmouseout="Hui(this)"><span class="xm">王五</span></div>
<div class="lb" onclick="Xuan(this)" xz="0" onmouseover="Bian(this)" onmouseout="Hui(this)"><span class="xm">老六</span></div>
<div class="lb" onclick="Xuan(this)" xz="0" onmouseover="Bian(this)" onmouseout="Hui(this)"><span class="xm">陈七</span></div>
</div>
<div class="zhu" onclick="show('a4')">  黑名单</div>
<div class="zi" id="a4">
<div class="lb" onclick="Xuan(this)" xz="0" onmouseover="Bian(this)" onmouseout="Hui(this)"><span class="xm">王二</span></div>
<div class="lb" onclick="Xuan(this)" xz="0" onmouseover="Bian(this)" onmouseout="Hui(this)"><span class="xm">王二</span></div>
</div> </div> <div id="d3" class="nr" style="background-color:greenyellow; display:none">
群聊
</div>
<div id="d4" class="nr" style="background-color:burlywood; display:none">
空间
</div>
</div>
</body>
</html>
<script type="text/javascript"> function Show(id)
{
//隐藏所有
var attr = document.getElementsByClassName("nr");
for(var i=0;i<attr.length;i++)
{
attr[i].style.display = "none";
}
//显示当前的
document.getElementById(id).style.display = "block";
} //实现列表的展开与叠起
function show(id)
{
var z=document.getElementById(id);
if (z.style.display=="block")
{
z.style.display="none";
}
else{
z.style.display="block";
}
}
//展开后列表背景颜色变为白色,选中好友变为橘黄色
function Xuan(a)
{
var attr = document.getElementsByClassName("lb"); for(var i=0;i<attr.length;i++)
{
attr[i].style.backgroundColor = "white";
attr[i].setAttribute("xz","0");
}
a.setAttribute("xz","1");
a.style.backgroundColor = "orange";
} //设置鼠标移动上的颜色变化
function Bian(a)
{
var attr = document.getElementsByClassName("lb"); for(var i=0;i<attr.length;i++)
{
if(attr[i].getAttribute("xz")=="0")
{
attr[i].style.backgroundColor = "white";
}
} a.style.backgroundColor = "lightblue";
}
//鼠标离开后颜色回到原先的背景颜色
function Hui(a)
{
var attr = document.getElementsByClassName("lb"); for(var i=0;i<attr.length;i++)
{
if(attr[i].getAttribute("xz")=="0")
{
attr[i].style.backgroundColor = "white";
}
}
}
</script>

  还需完善:

1、对话列表,群聊等未布局

2、什么时候能与数据库对接呢?聊天功能未实现?(期待聊天功能。)

qq面板(仿版,未完待续中。。。。)---2017-04-24的更多相关文章

  1. 省钱版----查找 IoT 设备TTL线序__未完待续

    作者:仙果 原文来自:省钱版—-查找 IoT 设备TTL线序 省钱版----查找 IoT 设备TTL线序__未完待续 缘由 在IoT固件调试分析的过程中,建议首先在IoT设备的板子上焊接调试线,这是能 ...

  2. Java开发中的23+2种设计模式学习个人笔记(未完待续)

    注:个人笔记 一.设计模式分三大类: 创建型模式,共五种:工厂方法模式.抽象工厂模式.单例模式.建造者模式.原型模式. 结构型模式,共七种:适配器模式.装饰器模式.代理模式.外观模式.桥接模式.组合模 ...

  3. Reading | 《数字图像处理原理与实践(MATLAB版)》(未完待续)

    目录 一.前言 1.MATLAB or C++ 2.图像文件 文件头 调色板 像素数据 3.RGB颜色空间 原理 坐标表示 4.MATLAB中的图像文件 图像类型 image()函数 imshow() ...

  4. [python]爬代理ip v2.0(未完待续)

    爬代理ip 所有的代码都放到了我的github上面, HTTP代理常识 HTTP代理按匿名度可分为透明代理.匿名代理和高度匿名代理. 特别感谢:勤奋的小孩 在评论中指出我文章中的错误. REMOTE_ ...

  5. Go web编程学习笔记——未完待续

    1. 1).GOPATH设置 先设置自己的GOPATH,可以在本机中运行$PATH进行查看: userdeMacBook-Pro:~ user$ $GOPATH -bash: /Users/user/ ...

  6. AutoMapper介绍(未完待续、部分没实现)

    实体间转换工具.其实也可以用Json来实现同名属性.异名属性(用JsonProperty指明)的自动转换 最新版本6.11 需要使用vs2013以上.vs2012下载新版 nuget会遇到问题.只能旧 ...

  7. git安装与使用,未完待续... ...

    ​ 目录 一.git概念 二.git简史 三.git的安装 四.git结构 五.代码托管中心-本地库和远程库的交互方式 六.初始化本地仓库 七.git常用命令 1.add和commit命令 2.sta ...

  8. javascript有用小功能总结(未完待续)

    1)javascript让页面标题滚动效果 代码如下: <title>您好,欢迎访问我的博客</title> <script type="text/javasc ...

  9. ASP.NET MVC 系列随笔汇总[未完待续……]

    ASP.NET MVC 系列随笔汇总[未完待续……] 为了方便大家浏览所以整理一下,有的系列篇幅中不是很全面以后会慢慢的补全的. 学前篇之: ASP.NET MVC学前篇之扩展方法.链式编程 ASP. ...

随机推荐

  1. 【Unity编程】欧拉角与万向节死锁(图文版)

    版权声明:本文为博主原创文章,欢迎转载.请保留博主链接:http://blog.csdn.net/andrewfan 万向节死锁(Gimbal Lock)问题 上文中曾经说过,欧拉旋转的顺规和轴向定义 ...

  2. yaourt 之 Curl 错误

    最近执行 yaourt 更新时总是出现以下错误: curl error: Couldn't connect to server 无法进行更新.把配置中的下载工具更换了成 axel 等其它下载工具,还是 ...

  3. tomcat升级,tomcat窗体改名,一台电脑安装多版本JDK

    1 tomcat改名:在bin目录下找到次文件(如图),按图上指示修改(比如我窗体是主数据) 修改后: 2 一台电脑安装多个版本的JDK 为什么我们要安装多个版本JDK?--我是因为tomcat修复漏 ...

  4. 关于php的flush在本机正常在服务器不灵的问题

    这个问题网上很多,我就不重复那些了. 我的是关于进度条的应用.我最后遇到的问题是,在本机swampserver环境下的输出缓存很快,但是到了服务器上就是一段一段的了.我的服务器是Web服务器是IIS. ...

  5. 修改jsp默认编码

    新建一个jsp页面默认的PageEncoding属性是iso8859-1,但是要使用中文的话,就乱码了,下面是修改新建jsp默认编码的步骤.

  6. 简单的android启动跳转页面

    java代码示例: package com.rcl; import android.app.Activity;import android.content.Intent;import android. ...

  7. Fiddler抓取https原理?

    参考:http://blog.csdn.net/xoopx/article/details/51577039 首先fiddler截获客户端浏览器发送给服务器的https请求, 此时还未建立握手.第一步 ...

  8. css 样式表 基础 样式

    1大小 width  宽度 height 高度 2 背景 background-color 背景色 background-image:url(图片位置) 背景图片 background-repeat: ...

  9. 【原创】Octovis在Ubuntu16.04下运行出现core dump的解决方案

    本人SLAM研究新手,使用系统为Ubuntu16.04.本文原址:http://www.cnblogs.com/hitlrk/p/6667253.html 在学习SLAM的过程中,使用Octomap进 ...

  10. React+ES6+Webpack环境配置

    转自http://www.cnblogs.com/chenziyu-blog/p/5675086.html 参考http://www.tuicool.com/articles/BrAVv2y Reac ...