之前做一个项目,感觉里面的弹出层做的挺好,但是代码结构有问题,这次用到了,重构了一下,改成jQuery的插件形式,并增加了reLoad的功能,感觉还不错,代码如下: 代码如下: (function($){ $.module={ _showCoverLayer:function(){//显示遮盖层 this.coverLayer=$("#TB_overlay"); var height=$(document).height()+"px"; var width=$(document).width()+"px"; if(this.coverLayer.length>0){ this.coverLayer.css({"visibility"...
方法一: [javascript] 代码如下:function hidePopup(){ var popUp = document.getElementById("popupcontent"); popUp.innerHTML=; popUp.style.visibility = "hidden"; } 方法二 代码如下:flashObject.stop();[javascript] document.getElementById(popupcontent).stop();
代码如下: JAVASCRIPT弹出层 #popDiv { position: absolute; visibility: hidden; overflow: hidden; border: 2px solid #AEBBCA; background-color: #EEF1F8; cursor: move; padding: 1px; } #popTitle { background: #9DACBF; height: 20px; line-height: 20px; padding: 1px; } #popForm { padding: 2px; } .title_left { font-weight: bold; padding-left: 5px; float: left; } .title_right { float: right; } #popTitle...
代码如下: $("#firefoxicon").click(function() { $("#window1").chinaz({ windowtitle: "firefox", windowpositiontop: "center", windowpositionleft: "center", windowwidth: 500, windowheight: 500, windowanimation: "easeoutcubic" });}); 轻松设置弹出层的效果,和弹出方...
这两天要用到正好练练手,比想象中碰到的问题要多,比如: ie6背景透明 ie6居中显示 还有对js对象的理解 openID=显示按钮,conID=需要显示的div,closeID=关闭按钮 解决了: 1.可以遮挡ie6下的select元素 但是在ie6下div没有透明度 2.弹出的div可以一直在浏览器屏幕中间显示 问题: 1.目前不支持.class 只支持#id 2.需要显示的div需要自己设置css 3.在ie6下需要设置css 例如div {_position: absolute;_top: expression(documentElement.sc...
代码如下: 点击文字弹出层 *{font-size:12px;font-family:Verdana, Geneva, sans-serif;line-height:14px}p{margin:0px; padding:0px;}a{color:#039} a:hover{color:#f60} .pop{position:absolute;left:40px;top:20px;width:380px;height:240px;background:#fff;border:8px solid #DDD;} .pop_head{position:relative; height:18px;}.pop_head img{ border:none; margin:8px 0px 0 0;}.pop_head a{position:absolute;ri...
点击弹出层外区域关闭弹出层jquery特效,废话不说,上代码,简洁明了: 代码如下: .hide{display:none;} .con{width:500px;height:300px;background:#000;} 点击弹出层 ,点击弹出层外区域关闭弹出层jquery特效 $(document).ready(function() { $("div.down").click(function(e) { e.stopPropagation(); $("div.con").removeClass("hide"); }); $("div.con a").click(function() { $("div.con").addClass("hide"); }); $(doc...
代码如下: jquery弹出层实例 $(function(){ $(".but").click(function(){ var str = "这里是信息内容,这里是信息内容!"; $(".form").html(str); $("#faqbg").css({display:"block",height:$(document).height()}); var yscroll =document.documentElement.scrollTop; $("#faqdiv").css("top","100px"); $("#faqdiv").css("display","block"); document.documentElement.scrollTop=0; }); $(".close").click(function(){ $(...
弹出层窗口永远居中 代码如下: 输出中,一个固定元素会出现于第一页的相同位置。这一点可用于生成流动标题或脚注。我们也见过相似的效果,但大都数效果不是通过CSS来实现了,而是应用了JS脚本。请特别注意,IE6不支持…… 这里我们用position:fixed;+ “hack技术” +“javascript”;结合来解决这一问题 代码如下: < html xmlns="http://www.w3.org/1999/xhtml"> < head> < meta http-equiv="Content-Type" content="text/htm...
如下所示: 代码如下: function alertWin(title, msg, w, h) { var titleheight = "22px"; // 窗口标题高度 var bordercolor = "#666699"; //窗口的边框颜色 var titlecolor = "#FFFFFF"; // 窗口的标题颜色 var titlebgcolor = "#666699"; // 窗口的标题背景色 var bgcolor = "#FFFFFF"; // 内容背景色 var iWidth = document.documentEleme...
js+css 实现遮罩居中弹出层(随浏览器窗口滚动条滚动) 代码如下: *{}{margin:0;padding:0;} html{}{_background:url(about:blank);} /**//* 阻止闪动 in IE6 , 把空文件换成about:blank , 减少请求 */ body{}{background:#fff; font: 12px/1.5 Tahoma,Geneva, \\5b8b\\4f53, sans-serif; height:100%;} .wrap{}{height:980px; padding-top:20px;text-align:center;} p{}{font-size:14px;text-align:center;line-height:24px;}...
如下所示: 代码如下: .toopTip { background-color:Yellow; border-style:solid; border-width:1px; border-color:Red; } /* 如果希望提示的div的左边界与上边界与显示的div重叠,那么需要删除文档头W3C标准 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> */ function in...
代码如下: 无标题文档 *{font-size:12px;font-family:Verdana, Geneva, sans-serif;line-height:14px} a{color:#039} a:hover{color:#f60} .pop{position:absolute;left:40%;top:40%;width:300px;height:100px;background:#eee;border:1px solid #ccc} .pop_head{position:relative;height:20px;background:#ccc} .pop_head a{position:absolute;right:8px;line-height:20px;color:#000;text-decoration:none} .pop_head a:hove...
今天给大家分享一款优秀的 jquery 弹出层展示插件 fancybox。它除了能够展示图片之外,还可以展示 flash、iframe 内容、html 文本以及 ajax 调用,我们可以通过 css 来自定义外观。fancybox 特点:可以支持图片、html 文本、flash 动画、iframe 以及 ajax 的支持;可以自定义播放器的 css 样式;可以以组的形式进行播放;如果将鼠标滚动插件(mouse wheel plugin)包含进来的话 fancybox 还能支持鼠标滚轮滚动来翻阅图片;fancybox...
代码如下:var t9 = new PopupLayer({trigger:"#ele9",popupBlk:"#blk9",closeBtn:"#close9",useOverlay:true,useFx:true,offsets:{x:0,y:-41}});t9.doEffects = function(way){ if(way == "open"){ this.popupLayer.css({opacity:0.3}).show(400,function(){ this.popupLayer.animate({ left:($(document).width() - this.popupLayer.width())/2, top:(document.documentEleme...