js window.open 打开新窗体 参数设置
<!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>无标题文档</title>
</head>
<form>
<input type="button" name="Button1" value="CN-Bruce" onclick="WinOpen()" />
<button onclick="window.open('http://www.aspxhome', '', 'width=800,height=300')">open1</button>
<button onclick="var newwin = window.open('http://www.aspxhome', '', 'width=800,height=300'); newwin.moveTo(50, 50), newwin.resizeTo(800, 300)">open2</button>
<button onclick="window.showModelessDialog('http://www.aspxhome', '', 'dialogWidth:800px;dialogHeight:300px')">open3</button>
<a href="#" onclick="window.open('http://www.aspxhome','target','param')">a11</a>
</form>
<body>
</body>
</html>
<!--window.open 参考文档:http://www.cnblogs.com/mfryf/archive/2013/06/10/3130286.html-->
<script language="JavaScript">
function WinOpen() {
//得到页面高度
var yScroll = (document.documentElement.scrollHeight > document.documentElement.clientHeight) ? document.documentElement.scrollHeight : document.documentElement.clientHeight;
//self.resizeBy = yScroll;
//得到页面宽度
var xScroll = (document.documentElement.scrollWidth > document.documentElement.clientWidth) ? document.documentElement.scrollWidth : document.documentElement.scrollWidth;
//self.resizeTo(xScroll - 200, yScroll - 200);
//self.moveTo(xScroll - 200, yScroll - 200);
var x = xScroll - 200;
var y = yScroll - 100;
//mesg = open("http://www.aspxhome", "DisplayWindow", "toolbar=no,,menubar=no,location=no,scrollbars=no");
//mesg.document.write("<HEAD><TITLE>中国asp之家</TITLE></HEAD>");
//mesg.document.write("<CENTER>http://www.aspxhome</CENTER>");
//window.open('http://www.aspxhome', '', 'width="' + x + 'px",height="' + y + '"px');
var featrures = "toolbar=no,menubar=no,location=no,scrollbars=yes,";
var newwin = window.open('http://www.aspxhome', 'target', featrures);
newwin.resizable = "yes";
newwin.moveTo(100, 10);
newwin.moveBy(100, 80);
top = 200
// newwin.resizeTo(x, y);
}
//得到页面高度
var yScroll = (document.documentElement.scrollHeight > document.documentElement.clientHeight) ? document.documentElement.scrollHeight : document.documentElement.clientHeight;
//self.resizeBy = yScroll;
//得到页面宽度
var xScroll = (document.documentElement.scrollWidth > document.documentElement.clientWidth) ? document.documentElement.scrollWidth : document.documentElement.scrollWidth;
//self.resizeTo(xScroll - 200, yScroll - 200);
//self.moveTo(xScroll - 200, yScroll - 200);
</script>
js window.open 打开新窗体 参数设置的更多相关文章
- window.open打开新窗口 参数
1,基本描述 oNewWindow = window.open( sURL , sName , sFeatures, bReplace) window.open在打开一个窗口(其url为sURL)后, ...
- window.open打开新窗体并用post方式传参
function openPostWindow(url,data,name){ //url要跳转到的页面,data要传递的数据,name显示方式(可能任意命名) var tempForm = docu ...
- Response.Redirect 打开新窗体的两种方法
普通情况下,Response.Redirect 方法是在server端进行转向,因此,除非使用 Response.Write("<script>window.location=' ...
- window.open()打开新窗口教程
使用 window 对象的 open() 方法可以打开一个新窗口.用法如下: window.open (URL, name, features, replace) 参数列表如下: URL:可选字符串, ...
- ajax回调打开新窗体防止浏览器拦截有效方法
ajax回调打开新窗体防止浏览器拦截,就这么做! 问题剖析: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 function click_fun(){ window ...
- ajax请求响应中用window.open打开新窗口会被浏览器拦截的解决方式
一.问题描述 ajax 异步请求成功后需要新开窗口打开 url,使用的是 window.open() 方法,但是会被浏览器给拦截了,需要用户点下. 二.问题分析 浏览器之所以拦截新开窗口是因为该操作并 ...
- Window.open()打开一个窗体不被拦截
Window.open()打开一个窗体不被拦截 在DataGrid中建一个模板列,在模板列中放一个客户端的Button,或者直接写你要的字句,然后用<a href>连接例:< ...
- 几个主流浏览器 Window.open打开新窗口 、模拟a标签打开新窗口的 表现
Window.open打开新窗口 1.常用浏览器打开新窗口(正常打开window.open)的的不同表现形式(PC/移动端) 2.Window.open在异步处理中打开(_blank) a标签在异步处 ...
- window.open()打开新窗口 及参数
在jsp页面中需要使用到弹出窗口,想到js的window对象有一个open方法可以弹出窗口,于是对open方法进行记录. 首先是open方法的语法及定义: 定义: open() 方法用于打开一个新的浏 ...
随机推荐
- DBCP连接池配置参数说明
<!-- 数据源1 --> <bean id="dataSource" class="org.apache.commons.dbcp.BasicData ...
- 如何在CTF中当搅屎棍
论如何在CTF比赛中搅屎 0×00 前言 不能搅屎的CTF不是好CTF,不能搅屎的题目不是好题目. 我很赞成phithon神的一句话,"比赛就是和他人竞争的过程,通过各种手段阻止对手拿分我觉 ...
- 审核被拒(后台定位,autio,voip,发表朋友圈)
APP上线审核被拒那些事(一) 2.3 - Apps that do not perform as advertised by the developer will be rejected 2.3 D ...
- C语言:结构体与数组
#include <stdio.h> struct book{ ]; ]; int price; }; ] = {,,,,,,,,,}; int main(){ struct book * ...
- Linux虚拟机突然不能上网了
之前是可以的,然后这次打开突然不能上网了. 更改配置后就好了: 配置如下: 我的问题是打开打开之后变成了OFF不是ON了.然后不管怎么改变O都失败了. 改为: 这样虚拟机这边就好了. 我们看下wind ...
- HTML5商城开发一 楼层滚动加载数据
对于楼层加载在以前只是个想法,从来没实现过,刚好项目中碰到,再此总结一下 场景:HTML5,局部商品列表信息滚动(局部滚动条) 1.通过jq设置subCategoryScroll的高度为屏幕显示高度( ...
- POJ 1743 Musical Theme
感觉最近好混乱......各种OJ都刷一点,感觉不太好......尤其是这种英文题 这道题一开始还没有看懂.听了ljh大犇的解释后终于明白了.下面我为英语和我一样的人翻译一下题面: 输入n个数.求最长 ...
- ReactNative真机运行指南
ReactNative真机运行指南 注意在iOS设备上运行React Native应用需要一个Apple Developer account并且把你的设备注册为测试设备.本向导只包含React Nat ...
- lecture10-模型的结合与全贝叶斯学习
这是Hinton的第10课 这节课有两篇论文可以作为背景或者课外读物<Adaptive mixtures of local experts>和<Improving neural ne ...
- leetcode - 位运算题目汇总(下)
接上文leetcode - 位运算题目汇总(上),继续来切leetcode中Bit Manipulation下的题目. Bitwise AND of Numbers Range 给出一个范围,[m, ...