1.我知道分辨率是有系统参数的, 不过我不知道是什么:)
2.换一个判断方式
ru: screen.width < 1024 --说明是 800 的或者更低:)//不知道行不行
2.换一个判断方式
ru: screen.width < 1024 --说明是 800 的或者更低:)//不知道行不行
解决方案 »
- 高手们,动态加载脚本后找不到加载的对象,怎么解决?
- 请帮忙看一下问题在哪里?谢谢!
- 怎样修改这个button的值呢,他本身写在了js中。
- 解释~~
- 用js如何判断div的内容是否为空。。。。。。。。。。。。。。。。
- 遇到困难急求帮助
- 给位老大 谁知道新版网易首页 新闻 北京新闻 娱乐 女人 教育 文化 鼠标划过变换内容是怎么做的???
- 如何得到一个节点的所有父节点,放入一个数组中
- 我用showModalDialog打开一个页面,如何在打开的页面上得到父窗口的域值?
- body标签中的onload事件处理程序加载多个函数问题
- 小弟是新手,如何用js编写这样的日期代码?
- 小弟想学习一下别人的JS,可是打开后发现没有换行,密密麻麻一大坨,请问怎么才能让他自动显示出缩进。
class_name是什么东西啊?
function bg_screen(class_name,bg_path,lbg_path) {
if ((screen.width == 800) && (screen.height == 600)) {
//aa.className = "bodybg2";
document.getElementById(class_name).style.backgroundColor = bg_path;
} else if ((screen.width == 1024) && (screen.height == 768)) {
//aa.className = "bodybg1"; document.getElementById(class_name).style.backgroundColor = lbg_path;
}
}</script>
同意楼上document.getElementById
<!--
//根据分辨率改变背景图
function bg_screen(class_name,bg_path,lbg_path)
{
if ((screen.width == 800) && (screen.height == 600)) {
//aa.className = "bodybg2";
class_name.background = bg_path;
}
else if ((screen.width == 1024) && (screen.height == 768)) {
//aa.className = "bodybg1";
class_name.background = lbg_path;
}
}//-->
</script><body id=bodybg1 onload=bg_screen(bodybg1,"image/155863.jpg","image/107198.gif") ></body>
function bg_screen(class_name,bg_path,lbg_path) {
if ((screen.width == 800) && (screen.height == 600)) {
//aa.className = "bodybg2";
document.getElementById(class_name).style.background = bg_path;
} else if ((screen.width == 1024) && (screen.height == 768)) {
//aa.className = "bodybg1"; document.getElementById(class_name).style.background = lbg_path;
}
}</script>
这个程序在具体运行的时候提示参数无效