明霞山资源网 Design By www.htccd.com
由于之前找到一个开源的很好用,可以固定在浏览器的右下角;兼容性也很好;加上之后影响到应用的一个小功能点,决定重写一个;这个只能固定在当前页面的右下加,系统是上下结构满足需求,没在继续扩展;
两个函数:
1.lay -- 设置提示框高宽(可选)
2.show -- 设置标题,内容,和停留时间
notice.js
var time;
var delayTime;
$(function(){
// 增加浮动DIV
$('body').append("<div id='notice' onselectstart='return false'><span class='notice_title'> </span><span class='cbtn'>[关闭]</span><div class='notice_content'></div></div>");
// 更改样式
$('#notice').css({right:"0",bottom:"0",cursor:"default",position:"fixed","background-color":"#CFDEF4",color:"#1F336B","z-index":"999",border:"1px #1F336B solid",margin:"2px",padding:"10px","font-weight":"bold","line-height":"25px",display:"none"});
$('#notice .cbtn').css({color:"#FF0000",cursor:"pointer","padding-right":"5px",float:"right",position:"relative"});
$('#notice .notice_content').css({margin:"3px","font-weight":"normal",border:"1px #B9C9EF solid","line-height":"20px","margin-bottom":"10px",padding:"10px"});
/* 绑定事件*/
$('#notice').hover(
function(){
$(this).stop(true,true).slideDown();
clearTimeout(time);
},
function(){
time = setTimeout('_notice()',delayTime);
}
);
//绑定关闭事件
$('.cbtn').bind('click',function(){
$('#notice').slideUp('fast');
clearTimeout(time);
});
});
$.extend({
lay:function(_width,_height){
$('#notice').css({width:_width,height:_height});
},
show:function(_title,_msg,_time){
delayTime = _time;
$('.notice_title').html(_title);
$('.notice_content').html(_msg);
$('#notice').slideDown(2000);
time = setTimeout('_notice()',delayTime);
},
});
function _notice(){
$('#notice').slideUp(2000);
}
index.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>index.html</title>
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3"/>
<meta http-equiv="description" content="this is my page"/>
<meta http-equiv="content-type" content="text/html; charset=GBK"/>
<!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
</head>
<body onload='initPage();'>
</body>
<script type="text/javascript">
function initPage(){
var returnMsg = "<p>信息1 jquery-1.7.2.min.js</p><p>信息2 notice.js</p><p>信息3</p>";
$.show('提示信息',returnMsg,10000);
}
</script>
<script src="/UploadFiles/2021-04-02/jquery-1.7.2.min.js">
以上所述就是本文的全部内容了,希望大家能够喜欢。
明霞山资源网 Design By www.htccd.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
明霞山资源网 Design By www.htccd.com
暂无评论...
RTX 5090要首发 性能要翻倍!三星展示GDDR7显存
三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。
首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。
据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。