`
chenhua_1984
  • 浏览: 1246128 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
文章分类
社区版块
存档分类
最新评论

js+html类似QQ右下角弹出提示的效果

阅读更多

js部分

<script type="text/javascript">
var handle;
function start()
{
 var obj = document.getElementById("tip");
 if (parseInt(obj.style.height)==0)
 { obj.style.display="block";
  handle = setInterval("changeH('up')",2);
 }else
 {
     handle = setInterval("changeH('down')",2) 
 } 
}
function changeH(str)
{
 var obj = document.getElementById("tip");
 if(str=="up")
 {
  if (parseInt(obj.style.height)>200)
   clearInterval(handle);
  else
   obj.style.height=(parseInt(obj.style.height)+8).toString()+"px";
 }
 if(str=="down")
 {
  if (parseInt(obj.style.height)<8)
  { clearInterval(handle);
   obj.style.display="none";
  }
  else  
   obj.style.height=(parseInt(obj.style.height)-8).toString()+"px"; 
 }
}
function showwin()
{
 document.getElementsByTagName("html")[0].style.overflow = "hidden";
 start();
 document.getElementById("shadow").style.display="block";
 document.getElementById("detail").style.display="block"; 
}
function recover()
{
 document.getElementsByTagName("html")[0].style.overflow = "auto";
 document.getElementById("shadow").style.display="none";
 document.getElementById("detail").style.display="none";  
}
</script>

  html部分

<body onload="document.getElementById('tip').style.height='0px'">

<div id="shadow"> </div>

<div id="detail"><h1><a href="javascript:void(0)" onclick="recover()">×</a>系统提示</h1>哈哈哈哈你~~~</div>

<div id="tip"><h1><a href="javascript:void(0)" onclick="start()">×</a>系统提示</h1><p><a href="javascript:void(0)" onclick="showwin()">点击这里查看详细</a></p></div>

<p><a href="javascript:void(0)" onclick="start()">点击这里测试</a></p>

</body>
</html>

总的html文件

<!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>页面右下角弹出提示信息,类QQ右下角新闻--Inghot</title>
<style type="text/css">
* {margin:0px;padding:0px;}
html,body {height:100%;}
body {font-size:14px; line-height:24px;}
#tip {position: absolute;right: 0px;bottom: 0px;height: 0px;width: 180px;border: 1px solid #CCCCCC;background-color: #eeeeee;padding: 1px;overflow:hidden;display:none;font-size:12px;z-index:10;}
#tip p {padding:6px;}
#tip h1,#detail h1 {font-size:14px;height:25px;line-height:25px;background-color:#0066CC;color:#FFFFFF;padding:0px 3px 0px 3px;}
#tip h1 a,#detail h1 a {float:right;text-decoration:none;color:#FFFFFF;}
#shadow {position:absolute;width:100%;height:100%;background:#CCCCCC;-moz-opacity:0.5;filter:Alpha(Opacity=50);opacity: 0.8;z-index:11;display:none;overflow:hidden;}
#detail {width:500px;height:200px;border:3px double #ccc;background-color:#FFFFFF;position:absolute;z-index:30;display:none;left:30%;top:30%}
</style>
<script type="text/javascript">
var handle;
function start()
{
 var obj = document.getElementById("tip");
 if (parseInt(obj.style.height)==0)
 { obj.style.display="block";
  handle = setInterval("changeH('up')",2);
 }else
 {
     handle = setInterval("changeH('down')",2) 
 } 
}
function changeH(str)
{
 var obj = document.getElementById("tip");
 if(str=="up")
 {
  if (parseInt(obj.style.height)>200)
   clearInterval(handle);
  else
   obj.style.height=(parseInt(obj.style.height)+8).toString()+"px";
 }
 if(str=="down")
 {
  if (parseInt(obj.style.height)<8)
  { clearInterval(handle);
   obj.style.display="none";
  }
  else  
   obj.style.height=(parseInt(obj.style.height)-8).toString()+"px"; 
 }
}
function showwin()
{
 document.getElementsByTagName("html")[0].style.overflow = "hidden";
 start();
 document.getElementById("shadow").style.display="block";
 document.getElementById("detail").style.display="block"; 
}
function recover()
{
 document.getElementsByTagName("html")[0].style.overflow = "auto";
 document.getElementById("shadow").style.display="none";
 document.getElementById("detail").style.display="none";  
}
</script>
</head>

<body onload="document.getElementById('tip').style.height='0px'">

<div id="shadow"> </div>

<div id="detail"><h1><a href="javascript:void(0)" onclick="recover()">×</a>系统提示</h1>哈哈哈哈你~~~</div>

<div id="tip"><h1><a href="javascript:void(0)" onclick="start()">×</a>系统提示</h1><p><a href="javascript:void(0)" onclick="showwin()">点击这里查看详细</a></p></div>

<p><a href="javascript:void(0)" onclick="start()">点击这里测试</a></p>

</body>
</html>
 

 

 

  • cc.rar (1.2 KB)
  • 下载次数: 153
分享到:
评论

相关推荐

    类似QQ右下角弹出消息效果

    在IT行业中,创建类似QQ右下角弹出消息的效果是一项常见的任务,特别是在开发桌面应用程序时。这个效果通常被称为“消息提示框”或“通知气泡”,它能够在不影响用户当前操作的情况下,快速向用户传递信息。以下是...

    页面设计,网页右下方弹出框,类似QQ,或者CSDN右下角的提示框

    在网页设计中,创建一个类似QQ或CSDN右下角的提示框是常见的功能,主要用于显示消息通知、广告信息或是交互反馈。这种提示框通常称为"气泡通知"或"浮层提示",它不干扰用户的主要操作,又能有效地传递信息。下面将...

    页面右下角弹出消息提示框类似QQ或者MSN+ASP.NET

    在ASP.NET开发中,创建一个类似QQ或MSN的页面右下角弹出消息提示框功能是一项常见的需求。这种提示框可以用于通知用户、显示警告信息或者进行交互式操作反馈。以下是一个详细的实现步骤和相关知识点: 1. **CSS布局...

    javascript 右下角弹出提示框

    利用javascript实现右下角弹出提示框。仿QQ

    jQuery 仿QQ右下角弹出消息提示.rar

    在网页交互设计中,模拟QQ右下角弹出消息提示的效果是一个常见的需求,它可以为用户带来更好的互动体验。本文将深入探讨如何利用jQuery来实现这一功能。 首先,我们要理解QQ右下角弹出消息提示的基本原理。这种提示...

    页面右下角弹出类似QQ或MSN的消息提示

    综上所述,实现"页面右下角弹出类似QQ或MSN的消息提示"这一功能,涉及到前端的JavaScript编程、CSS样式设计、动画效果实现,以及可能的后端实时通信。通过合理的技术选型和设计,可以创造出高效且用户友好的消息提示...

    好用的jquery类似QQ页面右下角弹出窗口

    标题提到的“好用的jquery类似QQ页面右下角弹出窗口”是指利用jQuery实现的一种模仿QQ聊天窗口从页面右下角弹出的效果。这种效果在网页通知、消息提示等方面非常常见,能够吸引用户的注意力而不会过于打扰他们的浏览...

    模拟QQ在网页右下角弹出提示窗口

    总结起来,模拟QQ在网页右下角弹出提示窗口主要涉及JavaScript的DOM操作、事件监听和CSS的定位、过渡效果。通过合理的代码组织和样式设计,我们可以创建出一个既实用又美观的提示系统,提升用户体验。

    模仿QQ消息提示右下角弹出窗口提示代码源文件4种不同方式

    "模仿QQ消息提示右下角弹出窗口提示代码源文件4种不同方式"是一个专注于实现这一功能的资源,它提供了多种实现此类通知的技术手段。下面将详细阐述这四种不同的实现方式以及它们在实际应用中的价值。 首先,右下角...

    页面右下角弹出类似QQ、MSN多条消息提示(提示可连接)

    综上所述,实现“页面右下角弹出类似QQ、MSN多条消息提示”的功能,需要结合JavaScript的动态操作DOM、事件处理和CSS的样式设计。这个过程既考验开发者的技术功底,也对用户体验有着直接影响。在实际开发中,应不断...

    【精华】页面右下角弹出类似QQ或MSN的消息提示

    标题中的“【精华】页面右下角弹出类似QQ或MSN的消息提示”指的是在网页设计中实现一种类似于即时通讯软件(如QQ、MSN)的消息提示功能。这种功能常见于许多网站,尤其是企业级应用,用于通知用户新消息、提醒或者...

    页面右下角弹出类似QQ或MSN的消息提示.rar

    总结一下,创建页面右下角弹出类似QQ或MSN的消息提示主要涉及以下步骤: 1. 创建HTML结构,包括弹窗容器、标题、内容区和关闭按钮。 2. 使用CSS进行样式设计,包括定位、尺寸、颜色和动画效果。 3. 使用JavaScript...

    js 仿qq右下角弹出窗口

    标题 "js 仿qq右下角弹出窗口" 指的是使用JavaScript编程技术来创建一个功能,模拟QQ软件在用户界面右下角显示通知或消息提示的效果。这种设计常见于许多网页应用,用于提醒用户有新的信息、更新或者活动。下面我们...

    一个类似QQ的用JavaScript实现的在网页右下角弹出窗口源码例子

    在网页设计和开发中,有时候我们需要创建类似即时通讯软件如QQ那样的交互式功能,例如在网页右下角弹出通知或对话窗口。这个压缩包提供了一些JavaScript代码示例,可以帮助我们实现这样的效果。以下是这些文件及其...

    真正屏幕右下角弹出消息窗口

    综上所述,这个程序运用HTML和JavaScript技术,模仿了QQ和MSN的右下角弹出通知功能,尤其在IE浏览器下表现良好,但可能与其他浏览器或特定环境存在兼容性问题。通过分析提供的文件,我们可以推测实现这一功能的核心...

    精美的网页右下角弹出提示框+仿QQ+仿百度

    本资源主题“精美的网页右下角弹出提示框+仿QQ+仿百度”聚焦于创建一种美观且功能丰富的提示框,其设计灵感来源于腾讯QQ和百度的产品样式。这个项目包含两个文件,分别模仿了QQ和百度的提示框效果,适用于那些希望在...

    仿QQ右下角弹出消息框.rar

    【标题】"仿QQ右下角弹出消息框.rar"是一个源码压缩包,它包含了一个设计精美的、模仿QQ应用程序右下角弹出消息效果的代码实现。这个功能在许多软件和网页应用中用于通知用户重要信息或者新消息,具有良好的用户体验...

    用javascript实现右下角弹出类似qq的动态弹出窗口的代码

    在JavaScript编程中,实现右下角动态弹出窗口的效果,是一种常见的用户交互设计...以上就是使用JavaScript实现右下角弹出层的基本过程和关键知识点。通过这些步骤,你可以创建出具有吸引力且不影响用户体验的通知系统。

Global site tag (gtag.js) - Google Analytics