/// <reference path="intellisense/jquery-1.2.6-vsdoc.js" />
var userAgent = navigator.userAgent.toLowerCase();
var is_opera = userAgent.indexOf('opera') != -1 && opera.version();
var is_moz = (navigator.product == 'Gecko') && userAgent.substr(userAgent.indexOf('firefox') + 8, 3);
var ua_match = /(trident)(?:.*rv:([\w.]+))?/.exec(userAgent) || /(msie) ([\w.]+)/.exec(userAgent);
var is_ie = ua_match && (ua_match[1] == 'trident' || ua_match[1] == 'msie') ? true : false; function LoadDialogWindow(URL, parent, loc_x, loc_y, width, height) {
if (is_ie)//window.open(URL);
window.showModalDialog(URL, parent, "edge:raised;scroll:1;status:0;help:0;resizable:1;dialogWidth:" + width + "px;dialogHeight:" + height + "px;dialogTop:" + loc_y + "px;dialogLeft:" + loc_x + "px", true);
else
window.open(URL, parent, "height=" + height + ",width=" + width + ",status=0,toolbar=no,menubar=no,location=no,scrollbars=yes,top=" + loc_y + ",left=" + loc_x + ",resizable=yes,modal=yes,dependent=yes,dialog=yes,minimizable=no", true);
}
function AddUser(inputid) { URL = "user.aspx?inputid=" + inputid;
loc_y = loc_x = 200;
height = 450;
if (is_ie) {
loc_x = document.body.scrollLeft + event.clientX - 100;
loc_y = document.body.scrollTop + event.clientY + 100;
height += 50;
}
LoadDialogWindow(URL, self, loc_x, loc_y, 550, height); //这里设置窗口的宽度和高度
}
//获取父窗口值
function getUserName(inputid) {
if (is_ie)
return window.dialogArguments.document.getElementsByName(inputid)[0].value;
else
return window.parent.opener.document.getElementById(inputid).value;
}
//设置父窗口值
function setUserName(inputid, users) {
if (is_ie)
window.dialogArguments.document.getElementsByName(inputid)[0].value = users;
else
window.parent.opener.document.getElementById(inputid).value = users;
} try { document.execCommand("BackgroundImageCache", false, true); } catch (e) { }
var popUpWin;
function PopUpCenterWindow(URLStr, width, height, newWin, scrollbars) {
var popUpWin = 0;
if (typeof (newWin) == "undefined") {
newWin = false;
}
if (typeof (scrollbars) == "undefined") {
scrollbars = 0;
}
if (typeof (width) == "undefined") {
width = 800;
}
if (typeof (height) == "undefined") {
height = 600;
}
var left = 0;
var top = 0;
if (screen.width >= width) {
left = Math.floor((screen.width - width) / 2);
}
if (screen.height >= height) {
top = Math.floor((screen.height - height) / 2);
}
if (newWin) {
open(URLStr, '', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=' + scrollbars + ',resizable=yes,copyhistory=yes,width=' + width + ',height=' + height + ',left=' + left + ', top=' + top + ',screenX=' + left + ',screenY=' + top + '');
return;
} if (popUpWin) {
if (!popUpWin.closed) popUpWin.close();
}
popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=' + scrollbars + ',resizable=yes,copyhistory=yes,width=' + width + ',height=' + height + ',left=' + left + ', top=' + top + ',screenX=' + left + ',screenY=' + top + '');
popUpWin.focus();
} function OpenModelWindow(url, option) {
var fun;
try {
if (parent != null && parent.$ != null && parent.$.ShowIfrmDailog != undefined) {
fun = parent.$.ShowIfrmDailog
}
else {
fun = $.ShowIfrmDailog;
}
}
catch (e) {
fun = $.ShowIfrmDailog;
}
fun(url, option);
}
function CloseModelWindow(callback, dooptioncallback) {
parent.$.closeIfrm(callback, dooptioncallback);
}
function StrFormat(temp, dataarry) {
return temp.replace(/\{([\d]+)\}/g, function(s1, s2) { var s = dataarry[s2]; if (typeof (s) != "undefined") { if (s instanceof (Date)) { return s.getTimezoneOffset() } else { return encodeURIComponent(s) } } else { return "" } });
}
function StrFormatNoEncode(temp, dataarry) {
return temp.replace(/\{([\d]+)\}/g, function(s1, s2) { var s = dataarry[s2]; if (typeof (s) != "undefined") { if (s instanceof (Date)) { return s.getTimezoneOffset() } else { return (s); } } else { return ""; } });
}
function getiev() {
var userAgent = window.navigator.userAgent.toLowerCase();
$.browser.msie8 = $.browser.msie && /msie 8\.0/i.test(userAgent);
$.browser.msie7 = $.browser.msie && /msie 7\.0/i.test(userAgent);
$.browser.msie6 = !$.browser.msie8 && !$.browser.msie7 && $.browser.msie && /msie 6\.0/i.test(userAgent);
var v;
if ($.browser.msie8) {
v = 8;
}
else if ($.browser.msie7) {
v = 7;
}
else if ($.browser.msie6) {
v = 6;
}
else { v = -1; }
return v;
}
$(document).ready(function() {
var v = getiev()
if (v > 0) {
$(document.body).addClass("ie ie" + v);
} });
  

Js 根据不同浏览器弹出窗口的更多相关文章

  1. IE浏览器弹出窗口

    //弹出一个对话框 参数的顺序: url, iWidth, iHeight, vArguments function openDialog() { var url, len = arguments.l ...

  2. Js(Jquery)实现的弹出窗口

    想实现一个弹出层,过一段时间自动消失的功能. 之前的项目中是:在页面中预先先一个<div>区域,默认隐藏或者因为没有内容不显示.当需要显示信息时,将该<div>填充上内容,并用 ...

  3. JS点击按钮弹出窗口

    由于没有系统学习过JS,遇到一个需求:点击按钮,弹出一个独立的窗口. 在网上百度了一下,并没有找到满意的结果,最重要的是各种方法很复杂.最终,仔细研究了一下,原来只是需要只要一个简单的函数就能满足自己 ...

  4. Skyline Terra Explorer6.6弹出窗口实现复制功能

    前段时间继续下来的基于Skyline的B/S项目,是基于Terra Explorer6.6实现的.项目中涉及到基于三维模型查询设备编码等操作,从用户友好角度来讲,查询到的设备编码应该要支持复制,方便用 ...

  5. window.open()弹出窗口防止被禁

    window.open(),顾名思义,是指在当前浏览器窗口弹出另一个浏览器窗口. 因为多种原因,浏览对window.open弹出的窗口做了多方限制.限制不同,肯定会造成各浏览器弹出窗口的差异. 大部分 ...

  6. [转]js来弹出窗口的详细说明

    1.警告对话框 <script> alert("警告文字") </script> 2.确认对话框 <script> confirm(" ...

  7. jquery-通过js编写弹出窗口

    本文转载 本文主要是通过js动态控制div的高度,css控制浮动 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional// ...

  8. js弹出窗口总结6种弹窗方法

    注: //关闭,父窗口弹出对话框,子窗口直接关闭 this.Response.Write("<script language=javascript>window.close(); ...

  9. JS弹出窗口代码大全(详细整理)

    1.弹启一个全屏窗口 复制代码代码如下: <html> <body http://www.jb51.net','脚本之家','fullscreen');">; < ...

随机推荐

  1. Servlet 工程 web.xml 中的 servlet 和 servlet-mapping 标签

    本文转载自 陈蒙的博客 最近在学习JavaEE轻量级框架,对于servlet-mapping中的url-partten标签以及网页访问时的执行顺序不是很清楚,搜索了很多遍终于找到了这篇博文(搜索也是个 ...

  2. Web Service数据源

    声明:原创作品,转载时请注明文章来自SAP师太技术博客( 博/客/园www.cnblogs.com):www.cnblogs.com/jiangzhengjun,并以超链接形式标明文章原始出处,否则将 ...

  3. c++初步实现的一个LRU

    #include<iostream>#include<map> using namespace std; typedef struct Node{ int data; stru ...

  4. hadoop2.7.3配置文件中过时的属性

    过时的属性:Deprecated Properties 该列表保存于:hadoop-2.7.3-src\hadoop-common-project\hadoop-common\src\site\mar ...

  5. linux下添加环境变量

    我安装完 RedHat Linux 5 之后,在终端使用一些命令,如: ifcinfig 查看本机的IP,发现不能使用此命令,提示说“command not found”,这该怎么办呢 想想肯定是环境 ...

  6. position之fixed固定定位、absolute绝对定位和relative相对定位

    什么是层模型? 什么是层布局模型?层布局模型就像是图像软件PhotoShop中非常流行的图层编辑功能一样,每个图层能够精确定位操作,但在网页设计领域,由于网页大小的活动性,层布局没能受到热捧.但是在网 ...

  7. LoadLibrary失败,GetLastError MOD_NOT_FOUND

    即使传入的.dll文件存在,也可能返回这个错误.因为加载的DLL库可能以来其他库,尤其是编译器的dll. 以腾讯的debug版libtim.dll为例:如果没有msvcr100d.dll和msvcp1 ...

  8. ActiveReports最终报表设计器本地化方法介绍

    ActiveReports UI界面中的所有字符信息.错误提示信息.以及一些logo.图像资源,都能够通过运行batch文件来本地化.本文主要介绍资源本地化的具体步骤: 1. 资源目录 所有可本地化的 ...

  9. VMware Workstation 10+Centos7(64位)共享文件夹

    这一两天一直在研究VMware Workstation自带的共享文件夹的功能,期间出了不少问题,在公司搭建的是vm10.0+centos07,在家搭建的是VM 7+centos07... 公司环境搭建 ...

  10. 我需要在Web上完成一个图片上传的功能后续(+1)

    微信入口施工完成.关键字识别中增加了本次活动的"关键字",在系统中增加了链接.不过,由于地址包含私密关键参数,这里隐藏,敬请原谅. 下一步,微信链接的地址页面是要对微信用户的信息进 ...