一般直接用 window.open方法弹出新窗口最大的问题是在给一些浏览器或工具拦截了, 这个问题比较难解决, 上次忽然想到当用户点击连接再弹出新窗口时是不会拦截的, 何不用JS模拟这个点击事件,所以马上试下, 果然可以, 哈哈,下面的实现方法的源码: 无标题文档 function myopen(url){ var oA = document.createElement('a'); oA.href = url; oA.target = '_blank'; document.body.appendChild(oA); oA.click(); } [Ctrl+A 全...
//more javascript from http://www.smallrain.net function sAlert(str){ var msgw,msgh,bordercolor; msgw=400;//提示窗口的宽度 msgh=100;//提示窗口的高度 titleheight=25 //提示窗口标题高度 bordercolor="#c51100";//提示窗口的边框颜色 titlecolor="#c51100";//提示窗口的标题颜色 var sWidth,sHeight; sWidth=screen.width; sHeight=screen.height; var bgObj=document.createElement("div"); bgObj.setAttribute('id','bg...
所以用的代码是: onChange="window.open(this.options[this.selectedIndex].value,'_blank')" 但这样很容易被屏蔽的...有更好的办法吗可以用变通的方法, 1.页面用 2.document.getElementById('aa').href=this.options[this.selectedIndex].value; 3.执行document.getElementById('aa').click
看下这个弹出窗口中写的函数或许你就明白了: 代码如下:function goIt(obj_id,obj_name) { window.opener.document.forms["myForm"].elements["form_plant_shu"].value = obj_name; window.opener.document.forms["myForm"].elements["form_plant_shu"].style.background = "white"; window.close(); return false; }
function openWin(u, w, h) { var l = (screen.width - w) / 2; var t = (screen.height - h) / 2; var s = 'width=' + w + ', height=' + h + ', top=' + t + ', left=' + l; s += ', toolbar=no, scrollbars=no, menubar=no, location=no, resizable=no'; open(u, 'oWin', s); } Test [Ctrl+A 全选 注:如需引入外部Js需刷新才能执行] javascript弹出窗口居中代码 下面给两个弹出屏幕居中窗口的例子 代码如下:window.open()方式...
不管是做网站还是一些应用系统,都免不了要用到一些弹出的效果,在ZJ-BLOG V1.0 Beta2版本我在一些功能使用了网络上比较流行的仿XP关机效果的弹出功能,按目前的反应来说还是效果不错的,下面将此功能整一下儿,如果有需要大家可以直接使用到自己的网站或是应用系统中去。 不在详细的说明代码了,帖出代码之前需要说明一点儿的是IE环境下,由于下拉框(select元素)优先级太高了,弹出的div元素无法盖住下拉框元素,很烦人的...
右下角弹窗效果练习 by 阿会楠 function $(obj){ return document.getElementById(obj); } function pop(obj){ var h = parseInt($("popDiv").currentStyle.height); $("popDiv").style.height = (h + obj) + "px"; if(parseInt($("popDiv").style.height) = 200){ window.clearInterval(timer); } } var timer; function runtimer(obj){ timer = window.setInterval(function(){pop(obj)},10); } window.onload = function(){ ru...
body { background:#333333;} #winpop { width:200px; height:0px; position:absolute; right:0; bottom:0; border:1px solid #999999; margin:0; padding:1px; overflow:hidden;display:none; background:#FFFFFF} #winpop .title { width:100%; height:20px; line-height:20px; background:#FFCC00; font-weight:bold; text-align:center; font-size:12px;} #winpop .con { width:100%; height:80px; line-height:80px; font-...
可滚动跟随弹出框效果代码——脚本之家 function getPosition() { var top = document.documentElement.scrollTop; var left = document.documentElement.scrollLeft; var height = document.documentElement.clientHeight; var width = document.documentElement.clientWidth; return {top:top,left:left,height:height,width:width}; } function showPop(){ var width = 300; //弹出框的宽度 var height = 160; //弹出框...
右下角弹出框 #rbbox{position:absolute;right:0;bottom:0;width:300px;height:0px;overflow:hidden} .button{display:inline;float:right;font-size:12px;cursor:pointer} 关闭 window.onload=function(){showBox();setTimeout("closeBox()",5000)} function showBox(o){ if (o==undefined) o=document.getElementById("rbbox"); o.style.height=o.clientHeight+2+"px"; if (o.clientHeight [Ctrl+A 全选 注:如需引入外部J...
代码如下:1. 2. function doInput() 3. { 4. var win = window.showModalDialog("http://www.baidu.com?source="+Math.random(),window,"dialogWidth=350px;dialogHeight=400px;center=yes;"); 5. } 6. JavaScript教程/参考手册 JavaScript热搜 vue2.0 移动端实现下拉刷新和上拉加载更多的示例解决vue-router中的query动态传参问题解决使用vue.js路由后失效的问题微信小程序实现换肤功能JS中touchstart事件与click事件...
代码如下:function LoadWindow(val) { URL="sendmsg.aspx?nickname="+val; loc_x=document.body.scrollLeft+event.clientX-event.offsetX; loc_y=document.body.scrollTop+event.clientY-event.offsetY; //window.showModalDialog(URL,self,"edge:raised;scroll:0;status:0;help:0;resizable:1;dialogWidth:450px;dialogHeight:450px;dialogTop:"+loc_y+"px;dialogLeft:"+loc_x+"px"); window.open(URL,null,"height=400,width=550...
强制弹出窗口代码研究-ForceWindow 此为一款老代码,本代码是通过构建一个 Form,然后用 JS 去 submit 这个 Form(也可以模拟提交按钮被 click)。我在 IE8 中测试起作用,但在 Firefox 3.5 中被拦截。 代码如下: ForceWindow.iclass.js 代码如下(使用、讲解、相关说明全部在注释中): /** * ====================================================== * 本程序可自由复制、修改、传播,不得删除以下信息。如用于商业用途须经原...
补增一个效果图! 模拟Popup body{ margin:0; padding:0; text-align:center; } #container{ margin:50px auto; padding:10px auto; } #popupcontent{ position:absolute; border:1px solid #000000; line-height:17px; background-color:#F7F7F4; visibility:hidden; cursor:default; padding:2 5 2 5px; } "; ocbody += "当前颜色"; for(var i=0;i"; ocbody += ""; if(i%6==5) ocbody += ""; } ocbody += ""; oPopB...
window.open使用方法以及参数说明一、window.open()支持环境: JavaScript1.0+/JScript1.0+/Nav2+/IE3+/Opera3+ 二、基本语法: window.open(pageURL,name,parameters) 其中: pageURL 为子窗口路径 name 为子窗口句柄 parameters 为窗口参数(各参数用逗号分隔) 三、各项参数 其中yes/no也可使用1/0;pixel value为具体的数值,单位象素。 参数 | 取值范围 | ...