javascript获取显示器尺寸
以下事例为结合本人电脑而设计的参数,您也可改为自己的尺寸
<SCRIPT LANGUAGE="JavaScript">
var chicun;
chicun=screen.width;
if(chicun==1280||chicun==1440||chicun==1600)
{
<!--
function initEcAd() {
document.all.AdLayer1.style.posTop = -100;
document.all.AdLayer1.style.visibility = 'visible';
document.all.AdLayer2.style.posTop = -100;
document.all.AdLayer2.style.visibility = 'visible';
MoveLeftLayer('AdLayer1');
MoveRightLayer('AdLayer2');
}
function MoveLeftLayer(layerName) {
var x = 10;
var y = 180;
var diff = (document.body.scrollTop + y - document.all.AdLayer1.style.posTop)*.40;
var y = document.body.scrollTop + y - diff;
eval("document.all." + layerName + ".style.posTop = parseInt(y)");
eval("document.all." + layerName + ".style.posLeft = x");
setTimeout("MoveLeftLayer('AdLayer1');", 100);
}
function MoveRightLayer(layerName) {
var x = 10;
var y = 180;
var diff = (document.body.scrollTop + y - document.all.AdLayer2.style.posTop)*.40;
var y = document.body.scrollTop + y - diff;
eval("document.all." + layerName + ".style.posTop = y");
eval("document.all." + layerName + ".style.posRight = x");
setTimeout("MoveRightLayer('AdLayer2');", 100);
}
document.write("<div id=AdLayer1 style='position: absolute;visibility:hidden;z-index:1'><EMBED src='js/banner.swf' quality=high WIDTH=100 HEIGHT=300 TYPE='application/x-shockwave-flash' id=dl></EMBED></div>"
+"<div id=AdLayer2 style='position: absolute;visibility:hidden;z-index:1'><EMBED src='js/banner.swf' quality=high WIDTH=100 HEIGHT=300 TYPE='application/x-shockwave-flash' id=dl></EMBED></div>");
initEcAd()
//-->
}
</SCRIPT>
相关文档:
click() 对象.click() 使对象被点击。
closed 对象.closed 对象窗口是否已关闭true/false
clearTimeout(对象) 清除已设置的setTimeout对象
clearInterval(对象) 清除已设置的setInterval对象
confirm("提示信息") 弹出确认框,确定返回true取消返回false
cursor:样式 更改鼠标样式 hand crosshair text wait help defa ......
注:页面上元素name属性和JavaScript引用的名称必须一致包括大小写
否则会提示你一个错误信息 "引用的元素为空或者不是对象"
---------------------------------------------------------------------
对象属性
document.title ......
<html>
<head>
<script language="javascript">
function overlay() {
xyz = document.getElementById("overlay");
&n ......
<html xmlns="http://www.w3.org/1999/xhtml" >
<head >
<title></title>
</head>
<body>
<form id="form1">
<div>
& ......
原帖地址:http://www.followman.com/bbs/Topic-B11-T262.aspx
JavaScript动态响应ATL事件
相关讨论:http://topic.csdn.net/t/20061012/21/5078729.html
重
点:脚本传过来的对象是IDispatch接口,应该用IDispatch::Invoke来调用。如果传过来的是个function,那么DISPID
为0,如果是个对象,那么要先用GetIDsOfNames得 ......