- 浏览: 2478822 次
- 性别:
- 来自: 苏州
文章分类
最新评论
-
jsntghf:
peio 写道这个怎么运行?Ruby On Rails的环境搭 ...
多文件上传之uploadify -
peio:
这个怎么运行?
多文件上传之uploadify -
往事如烟1:
我的项目是自己init了一个原始的project,之后将ver ...
React Native热部署之CodePush -
jsntghf:
往事如烟1 写道我按照你的说明进行,发现app退出之后,在进入 ...
React Native热部署之CodePush -
往事如烟1:
我按照你的说明进行,发现app退出之后,在进入不正确,请问是什 ...
React Native热部署之CodePush
首先,看一下页面。
<!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" /> <script src="jquery-pack.js"></script> <script type="text/javascript"> $(function(){ $("#newnotice").floatdiv(""); $(window).load(function(){ $("div[id=newnotice]").slideDown("slow"); }) $("label[id=tomin]").click(function(){ $("div[id=noticecon]","div[id=newnotice]").slideUp(); }); $("label[id=tomax]").click(function(){ $("div[id=noticecon]","div[id=newnotice]").slideDown(); }); $("label[id=toclose]").click(function(){ $("div[id=newnotice]").hide(); }); }); jQuery.fn.floatdiv=function(location){ //ie6要隐藏纵向滚动条 var isIE6=false; if($.browser.msie && $.browser.version=="6.0"){ $("html").css("overflow-x","auto").css("overflow-y","hidden"); isIE6=true; }; $("body").css({margin:"0px",padding:"0 10px 0 10px", border:"0px", height:"100%", overflow:"auto" }); return this.each(function(){ var loc;//层的绝对定位位置 if(location==undefined || location.constructor == String){ switch(location){ case("rightbottom")://右下角 loc={right:"0px",bottom:"0px"}; break; case("leftbottom")://左下角 loc={left:"0px",bottom:"0px"}; break; case("lefttop")://左上角 loc={left:"0px",top:"0px"}; break; case("righttop")://右上角 loc={right:"0px",top:"0px"}; break; case("middle")://居中 var l=0;//居左 var t=0;//居上 var windowWidth,windowHeight;//窗口的高和宽 //取得窗口的高和宽 if (self.innerHeight) { windowWidth=self.innerWidth; windowHeight=self.innerHeight; }else if (document.documentElement&&document.documentElement.clientHeight) { windowWidth=document.documentElement.clientWidth; windowHeight=document.documentElement.clientHeight; } else if (document.body) { windowWidth=document.body.clientWidth; windowHeight=document.body.clientHeight; } l=windowWidth/2-$(this).width()/2; t=windowHeight/2-$(this).height()/2; loc={left:l+"px",top:t+"px"}; break; default://默认为右下角 loc={right:"0px",bottom:"0px"}; break; } }else{ loc=location; } $(this).css("z-index","9999").css(loc).css("position","fixed"); if(isIE6){ if(loc.right!=undefined){ $(this).css("right","18px"); } $(this).css("position","absolute"); } }); }; </script> <link href="notice.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="newnotice"> <p><span class="title">最新公告</span> <span id="bts"> <label class="button" id="tomin" title="最小化">-</label> <label class="button" id="tomax" title="最大化">+</label> <label class="button" id="toclose" title="关闭">x</label> </span></p> <div id="noticecon"> 最新公告最新公告最新公告最新公告最新公告最新公告最新公告最新公告最新公告最新公告最新公告最新公告最新公告最新公告最新公告最新公告 </div> </div> </body> </html>
接着,看一下样式:
html { background:#ccc } #newnotice { display: block; } #newnotice { width: 250px; border: solid #9BDF70 1px; background-color: #F0FBEB; } #newnotice p { font-size: 12px; margin: 1px; padding: 0px 2px 0px 5px; background-color: #C2ECA7; color: #666666; height: 20px; line-height: 20px; } #newnotice p .title { float: left; } #newnotice p #bts { display: block; float: right; width: 48px; height: 15px; } #newnotice p #bts .button { display: block; float: left; width: 15px; height: 15px; line-height: 15px; cursor: pointer; } #newnotice div { font-size: 12px; margin: 1px; padding: 0px 5px 0px 5px; background-color: #FFFFFF; color: #999999; height: 75px; line-height: 20px; }
该浮动层是一个任意位置浮动固定层,可以让指定的层浮动到网页上的任何位置,当滚动条滚动时它会保持在当前位置不变,不会产生闪动。
下面,看一下具体的参数调用示例:
1 无参数调用:默认浮动在右下角 $("#id").floatdiv(); 2 内置固定位置浮动 //右下角 $("#id").floatdiv("rightbottom"); //左下角 $("#id").floatdiv("leftbottom"); //左上角 $("#id").floatdiv("lefttop"); //右上角 $("#id").floatdiv("righttop"); //居中 $("#id").floatdiv("middle"); 3 自定义位置浮动 $("#id").floatdiv({left:"10px",top:"10px"});
- float.rar (15 KB)
- 下载次数: 164
发表评论
-
密码输入延迟屏蔽
2013-05-19 20:06 1425这是一个类似iPhone、android等手机的密码输入体 ... -
日历控件
2012-06-29 20:12 1530<link rel="styleshee ... -
渐变打分条
2011-11-05 10:33 1623<!DOCTYPE html PUBLIC &qu ... -
滚动新闻
2011-10-28 15:17 1115<div id="marquees" ... -
网页配色
2011-10-10 09:18 1681至于为什么要使用网页配色工具,而不是自己配色,主要原因就是:对 ... -
圆角文本框的实现
2011-10-09 09:22 3343<!DOCTYPE HTML PUBLIC " ... -
javascript加载xml,在chrome下失败的解决办法
2011-09-30 09:40 4714原来的写法: this.loadxml = funct ... -
可输入文本的下拉框
2011-09-28 13:14 1325<html> <head> ... -
二级树形菜单
2011-09-25 11:34 1283<!DOCTYPE html PUBLIC &qu ... -
不规则菜单
2011-09-16 09:31 1284<!DOCTYPE html PUBLIC " ... -
二级树形菜单
2011-09-13 19:11 1270<!DOCTYPE html PUBLIC &qu ... -
随机显示图片
2011-09-10 18:13 1290<!DOCTYPE html PUBLIC " ... -
滚动字幕效果
2011-09-07 17:40 1383<!DOCTYPE html PUBLIC " ... -
美化select
2011-09-06 16:50 1299<!DOCTYPE html PUBLIC " ... -
无图片圆角
2011-09-05 15:10 1355<!DOCTYPE HTML PUBLIC " ... -
设置滚动条的颜色
2011-08-11 10:01 1678<style type="text/css&q ... -
CSS细线表格
2011-08-09 13:23 1501<style type="text/css&q ... -
分页效果
2011-08-06 19:52 1248<!DOCTYPE html PUBLIC &qu ... -
FormTools
2011-06-23 09:17 1345FormTools is a collection of ut ... -
表单当前行高亮的实现
2011-06-21 12:06 1400<!DOCTYPE html PUBLIC " ...
相关推荐
原生js div网页右下角浮动提示层可缩小和关闭浮动提示层
本代码段基于jquery框架实现背景透明的浮动提示层,这个在做ajax方面时比较常用。此段代码编码是UTF-8,运行在PHP环境。 BUG修改,在closeFlLayer函数的修改为如下代码: function closeFlLayer(fl_Obj) { fl_Obj....
jquery提示框插件自定义多个方向浮动提示层
jQuery.UI.Impromptu.js jQuery 弹出层 浮动层 提示框 并随页面滚动而滚动 实现弹出层不再难,只要引用jQuery.UI.Impromptu.js这个js文件后,想要弹出哪个tag都行了 如:我想要这里是弹出浮动遮罩层</div> 并随页面...
jquery浮动层提示框制作右下角float div提示框向上滑动提示,类似MSN/QQ、阿里旺旺的浮动层提示框特效
注意:那个如果你的模板有CSS文件的话,就要直接引入到本页面就行了,这个简化版不能在别的框架弹出层的,所以也就没有了那个cssurl属性了,也没有target 属性了
超多的jQuery Ajax浮动提示特效,这些浮动提示效果有圆角样式,有渐变动画,还可关闭,带有阴影,有些是有动画效果的,如示例截图所示,很多种风格样式,十分漂亮,通过本示例,你可以学会这些浮动提示层的用法.
使用浮动透明层来提示数据,很漂亮的显示方式
jquery万能浮动层提示框插件图片、文字、表单文字提示等提示框
多样式简洁的JS浮动提示窗口,具体来说是链接提示窗口,链接提示特效,鼠标放在链接文字上的时候,自动弹出来,支持自定义窗口标题和文字正文,鼠标移走后,浮动提示自动消失,基于CSS和JavaScript共同实现,如截图...
鼠标放到图片上 出现的 新闻列表 或 其他提示浮动层效果
仿Windows的气泡提示,基于CSS方法实现,可作为网页上的信息提示窗口。效果描述:鼠标放在图片上,立即显示带小缺口的浮动提示层,鼠标移开后提示消失。
NULL 博文链接:https://canlynet.iteye.com/blog/2259275
原生js css3弹窗提示框,点击按钮弹出浮动提示层。主要内容提示框,警告提示框,成功提示框代码。
jquery浮动层特效或弹出层特效loading页面加载过程,异步加载loading特效。提示用户loading页面加载效果。
4、自定义浮动提示,模拟title的tip提示显示,右上角固定位置的操作提示层(ajax请求中提示,页面跳转中提示等)。 5、自定义容器装载外部图片,无柔化投影。 6、鼠标跟随效果,智能垂直方向、水平方向跟随。 烈火...
摘要:脚本资源,jQuery,浮动框 jQuery实现的适用于图片、链接的浮动提示信息框,鼠标移上去后,会显示一个浮动的层,这个层可用于提示图片和文字信息,比较不错。希望大家喜欢。
基于 AngularJS 的浮层组件,由 artDialog 演进而来。 使用 AngularJS 自带的ng-if、ng-show、ng-hide控制浮层的显示与隐藏 支持 ARIA 规范、无障碍焦点管理、快捷键关闭 ...可以指定元素对齐或者页面居中显示 ...