在<div>中如何引用JavaScript变量
JScript code:
var winHeight=0;
function findDimensions() //函数:获取尺寸
{
//获取窗口高度
if(window.innerHeight)
winHeight=window.innerHeight;
else if((document.body)&&(document.body.clientHeight))
winHeight=document.body.clientHeight;
//通过深入Document内部对body进行检测,获取窗口大小
if(document.documentElement && document.documentElement.clientHeight && document.documentElement.clientWidth)
{
winHeight=document.documentElement.clientHeight-140;
//winWidth=document.documentElement.clientWidth;
}
//document.write (winHeight);
}
findDimensions();
window.onresize=findDimensions;
如何把winheight赋值给
<div id="Grid" style="height:200px;">
document.getElementById("Grid").style.height= winheight
document.getElementById("Grid").style.height=winheight;
该说的都让楼上的两位说了。。。
俺是JAVASCRIPT菜鸟都算不上。
写在哪?
<div>怎么写?
或者javascript怎么写?
HTML code:
<script>
var winHeight=0;
function findDimensions() //函数:获取尺寸
{
//获取窗口高度
if(window.innerHeight)
winHeight=window.innerHeight
相关问答:
在很久很久以前,我们这些80后的小朋友终于玩上了自己的小霸王游戏机,超级玛丽,玛丽医生,雪人兄弟,诸多经典游戏让人无法忘怀,成为一个心结!
在完成了俄罗斯方块后,这是我写的又一个JavaScript游戏,玛 ......
C#写JAVASCRIPT 数组
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
& ......
在javascript中,方法的返回(x,y)类型的值,应该怎样接收
返回(x,y)类型? 这是什么类型?
就像方法中,return (1,2)
我怎么没见过你说的这种写法?
直接接,js 是弱类型,接到后须自行处理!
......
我把做了一个ascx控件,代码如下:
<table width="728" border="0" align="center" cellpadding="0" cellspacing="0">
<tr&g ......
function addCookie(name,value)
{
var Days = 30;
var exp = new Date();
exp.setTime(exp.getTime() + Days*24*60*60*1000);
// al ......