| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 690 人关注过本帖
标题:关于C#执行JS的迷惑,请各位指点.
只看楼主 加入收藏
jacklee
Rank: 7Rank: 7Rank: 7
来 自:XAplus
等 级:贵宾
威 望:32
帖 子:1769
专家分:104
注 册:2006-11-3
结帖率:100%
收藏
 问题点数:0 回复次数:1 
关于C#执行JS的迷惑,请各位指点.
我遇到这样一个问题,我将其放在HTML里面能正常滚动,但放在我的(C#)页面里面就定型了,不动了。
这是一个对联广告的JS。
我放在JS文件中引用,能显示,但是不随着页面拉动而移动,请各位帮助看一下.!感谢!

<!--
var showad = true;
var Toppx = 60;            //上端位置
var AdDivW = 100;        //宽度
var AdDivH = 360;        //高度
var PageWidth = 800;    //页面多少宽度象素下正好不出现左右滚动条
var MinScreenW = 1024;    //显示广告的最小屏幕宽度象素

var ClosebuttonHtml = '<div align="right" style="position: absolute;top:0px;right:0px;margin:2px;padding:2px;z-index:2000;"><a href="javascript:;" onclick="hidead()" style="color:red;text-decoration:none;font-size:12px;">关闭</a></div>'
var AdContentHtml = '<div align="center" style="color:green;font-size:23pt;font-family:黑体;"><br><br>广<br>告<br>内<br>容</div>';
document.write ('<div id="Javascript.LeftDiv" style="position: absolute;border: 1px solid #336699;background-color:#EEEEE2;z-index:1000;width:'+AdDivW+'px;height:'+AdDivH+'px;top:-1000px;word-break:break-all;display:none;">'+ClosebuttonHtml+'<div>'+AdContentHtml+'</div></div>');
document.write ('<div id="Javascript.RightDiv" style="position: absolute;border: 1px solid #336699;background-color:#EEEEE2;z-index:1000;width:'+AdDivW+'px;height:'+AdDivH+'px;top:-1000px;word-break:break-all;display:none;">'+ClosebuttonHtml+'<div>'+AdContentHtml+'</div></div>');
function scall(){
    if(!showad){return;}
    if (window.screen.width<MinScreenW){
        alert("临时提示:\n\n显示器分辨率宽度小于"+MinScreenW+",不显示广告");
        showad = false;
        document.getElementById("Javascript.LeftDiv").style.display="none";
        document.getElementById("Javascript.RightDiv").style.display="none";
        return;
    }
    var Borderpx = ((window.screen.width-PageWidth)/2-AdDivW)/2;

    document.getElementById("Javascript.LeftDiv").style.display="";
    document.getElementById("Javascript.LeftDiv").style.top=document.body.scrollTop+Toppx;
    document.getElementById("Javascript.LeftDiv").style.left=document.body.scrollLeft+Borderpx;
    document.getElementById("Javascript.RightDiv").style.display="";
    document.getElementById("Javascript.RightDiv").style.top=document.body.scrollTop+Toppx;
    document.getElementById("Javascript.RightDiv").style.left=document.body.scrollLeft+document.body.clientWidth-document.getElementById("Javascript.RightDiv").offsetWidth-Borderpx;
}

function hidead()
{
    showad = false;
    document.getElementById("Javascript.LeftDiv").style.display="none";
    document.getElementById("Javascript.RightDiv").style.display="none";
}
window.onscroll=scall;
window.onresize=scall;
window.onload=scall;
//-->
搜索更多相关主题的帖子: style 广告 左右 
2007-12-11 16:16
jacklee
Rank: 7Rank: 7Rank: 7
来 自:XAplus
等 级:贵宾
威 望:32
帖 子:1769
专家分:104
注 册:2006-11-3
收藏
得分:0 
这是我的引用。。

<script type ="text/javascript" language="javascript" src="doubleadvertisement.js"></script>

</head>

XAplus!
讨论群:51090447
删吧删吧,把我的号给删了!
2007-12-11 16:17
快速回复:关于C#执行JS的迷惑,请各位指点.
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.014603 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved