麻烦 LZ 把全部代码发出来,至少发一个能直接调用的只有 js ,都不知道怎么调用!!!
解决方案 »
- 请各位看看我这个cookie的错误!!!!!!
- 新手 ~需高人指点
- 为什么有的时候onclick在firefox下不管用啊
- 关于JS代码滚动问题
- javascript 怎样实现点击链接后调用windows media player播放wmv?
- 在一个div里设置属性style="display:none" 为什么js就获取不到文本框里的值
- 获取当前触发的并没执行事件的列表,并操作它。
- 怎么取消disable属性
- 小弟在线急求一正则表达式,要求文本框只能输入001~999之间的数字,必须三位
- 怎样禁止table中许多text元素被写入?
- 唉,还得请教高人,怎样控制该js菜单展开的菜单
- 求哪位捞我
function MoveRightLayer(layerName) {
//var x = 5;
var x = document.body.scrollLeft + document.body.clientWidth - 160 +'px';
var y = (document.body.clientHeight - 200)/2;
var diff = (document.body.scrollTop + y - document.all.AdLayer.style.posTop)*.40;
var y = document.body.scrollTop + y - diff;
eval("document.all." + layerName + ".style.posTop = y");
eval("document.all." + layerName + ".style.left = x");
setTimeout("MoveRightLayer('AdLayer');",20);
}
window.onscroll
//---------------------------------------------
window.onresize=function(){
var thisObj = document.getElementById("AdLayer");
if (thisObj){
thisObj.style.pixelLeft=document.body.offsetWidth-180;
thisObj.style.pixelTop=(document.body.clientHeigh-200)/2;
}
}
//---------------------------------------------
function initEcAd() {
document.all.AdLayer.style.posTop = -200;
document.all.AdLayer.style.visibility = 'visible'
MoveRightLayer('AdLayer');
}
function MoveRightLayer(layerName) {
var x = 5;
var y = (document.body.clientHeight - 200)/2;
var diff = (document.body.scrollTop + y - document.all.AdLayer.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('AdLayer');",20);
}
var hover='orange',normal='slategray';//color;
var index=1;//z-index;
//最小化;
function min(obj)
{
var win = obj.parentNode.parentNode;
var sha = win.nextSibling;
var tit = obj.parentNode;
var msg = tit.nextSibling;
var flg = msg.style.display=="none";
if(flg)
{
win.style.height = parseInt(msg.style.height) + parseInt(tit.style.height) + 2*2;
sha.style.height = win.style.height;
msg.style.display = "block";
obj.innerHTML = "0";
}
else
{
win.style.height = parseInt(tit.style.height) + 2*2;
sha.style.height = win.style.height;
obj.innerHTML = "2";
msg.style.display = "none";
}
}
//关闭;
function cls(obj)
{
var win = obj.parentNode.parentNode;
var sha = win.nextSibling;
win.style.visibility = "hidden";
sha.style.visibility = "hidden";
} //创建一个对象;
function xWin(id,w,h,l,t,tit,msg)
{
index = index+2;
this.id = id;
this.width = w;
this.height = h;
this.left = l;
this.top = t;
this.zIndex = index;
this.title = tit;
this.message = " <a href='#'>浏览过的页面 </a>";
this.obj = null;
this.bulid = bulid;
this.bulid();
} //初始化;
function bulid()
{
var str = ""
+ " <div id=" + this.id + " "
+ "style='"
+ "z-index:" + this.zIndex + ";"
+ "width:" + this.width + ";"
+ "height:" + this.height + ";"
+ "left:" + this.left + ";"
+ "top:" + this.top + ";"
+ "color:" + normal + ";"
+ "font-size:10px;"
+ "font-family:Verdana;"
+ "position:absolute;"
+ "cursor:default;"
+ "border:2px solid " + normal + ";"
+ "' "
+ "onmousedown='getFocus(this)'>"
+ " <div "
+ "style='"
+ "background-color:" + normal + ";"
+ "width:" + (this.width-2*2) + ";"
+ "height:20;"
+ "color:white;"
+ "' "
+ "ondblclick='min(this.childNodes[1])'"
+ ">"
+ " <span style='width:12;border-width:0px;color:white;font-family:webdings;' onclick='min(this)'>0 </span>"
+ " <span style='width:12;border-width:0px;color:white;font-family:webdings;' onclick='cls(this)'>r </span>"
+ " </div>"
+ " <div style='"
+ "width:100%;"
+ "height:" + (this.height-20-4) + ";"
+ "line-height:14px;"
+ "word-break:break-all;"
+ "padding:3px;"
+ "'>" + this.message + " </div>"
+ " </div>"
+ " <div style='"
+ "width:" + this.width + ";"
+ "height:" + this.height + ";"
+ "top:" + this.top + ";"
+ "left:" + this.left + ";"
+ "z-index:1;"
+ "position:absolute;"
+ "filter:alpha(opacity=40);"
+ "'> </div>";
document.body.insertAdjacentHTML("beforeEnd",str);
}
<!--
function initialize()
{
var a = new xWin("AdLayer",160,200,document.body.clientWidth-160, (document.body.clientHeight-200)/2,""," <a href='#'>浏览过的页面 </a>");
initEcAd();
} window.onload = initialize;
//-->
var thisObj = document.getElementById("AdLayer");
if (thisObj){
thisObj.style.pixelLeft=document.body.clientHeigh-160;
thisObj.style.pixelTop=(document.body.clientHeigh-200)/2;
}
}在脚本里添加以上代码
window.onresize=function(){
var thisObj = document.getElementById("AdLayer");
if (thisObj){
thisObj.style.pixelLeft=document.body.clientWidth-160;
thisObj.style.pixelTop=(document.body.clientHeigh-200)/2;
}
}