`

仿腾讯弹出网页层效果(兼容主流浏览器)

    博客分类:
  • html
阅读更多
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>仿腾讯弹出网页层效果(兼容主流浏览器)</title>
<style>
body {background: #ffffff; color: #444;}
a{ color: #09d; text-decoration: none; border: 0; background-color: transparent;}
body,div,q,iframe,form,h5{ margin: 0; padding: 0;}
img,fieldset { border: none 0; }
body,td,textarea { word-break: break-all; word-wrap: break-word; line-height:1.5;}
body,input,textarea,select,button { margin: 0; font-size: 12px; font-family: Tahoma, SimSun, sans-serif;}
div,p,table,th,td { font-size:1em; font-family:inherit; line-height:inherit;}
h5{ font-size:12px;}
</style>
<script type="text/javascript" src="http://www.5-studio.com/wp-content/uploads/2009/06/Dialog.js"></script>
<script type="text/javascript" src = 'zoac.js'></script>
</head>
<body>
<div id="_div"></div>
	<input type="button" value="弹出新窗口" onclick="zOpen()" />
	<input type="button" value="弹出带说明的新窗口" onclick="zOpenD()" />&nbsp;
	<input type="button" value="弹出信息提示对话框" onclick="zAlert()" />&nbsp;
	<input type="button" value="弹出选择对话框" onclick="zConfirm()" />
<script>sometext("_div",100);</script>
</body>
</html>

 

function $(ele) {
	if (typeof(ele) == 'string'){
		ele = document.getElementById(ele);
		if(!ele)
			return null;
	}
	if(ele){
		Core.attachMethod(ele);
	}
	return ele;
}
var Core = {};
Core.attachMethod = function(ele){
	if(!ele||ele["$A"]){
		return;
	}
	if(ele.nodeType==9){
		return;
	}
	var win;
	try{
		if(isGecko){
			win = ele.ownerDocument.defaultView;
		}else{
			win = ele.ownerDocument.parentWindow;
		}
		for(var prop in $E){
			ele[prop] = win.$E[prop];
		}
	}catch(ex){
	//alert("Core.attachMethod:"+ele)//有些对象不能附加属性,如flash
	}
}

function zOpenD(){
	var diag = new Dialog("Diag1");
	diag.Width = 900;
	diag.Height = 400;
	diag.Title = "弹出窗口示例";
	diag.URL = "http://ueaner.iteye.com/";
	diag.ShowMessageRow = true;
	diag.MessageTitle = "Ueaner";
	diag.Message = "更多JS、JQuery、PHP内容";
	diag.OKEvent = zAlert;//点击确定后调用的方法
	diag.show();
}
function zOpen(){
	var diag = new Dialog("Diag2");
	diag.Width = 900;
	diag.Height = 400;
	diag.Title = "Ueaner";
	diag.URL = "http://ueaner.iteye.com/";
	diag.OKEvent = zAlert;//点击确定后调用的方法
	diag.show();
}
function zAlert(){
	Dialog.alert("可以静心也");
}
function zConfirm(){
	Dialog.confirm('警告:请确认',function(){Dialog.alert("yeah,周末到了,正是好时候");});
}
function sometext(ele,n){
/* 	var strArr=["可","以","清","心","也"];
	var writeStr=""
	for(i=0;i<n;i++){
		index=parseInt(Math.random()*5);
		for(j=0;j<5;j++){
			str=index+j>4?index+j-5:index+j;
			writeStr+=strArr[str];
		}
	}
	$(ele).innerHTML=writeStr;
*/
}



来自:http://www.rainweb.cn/article/134.html


点击下载Demo文件   --   或在下面附件中下载

 

  • Dialog.rar (8.7 KB)
  • 描述: 仿腾讯弹出网页层效果
  • 下载次数: 100
分享到:
评论
1 楼 jy1245626 2010-05-27  
看到$,可以知道跟jquery不能共用

相关推荐

Global site tag (gtag.js) - Google Analytics