如何减去'2'from var width=document.documentElement.clien
how to subtract '2' from var width = document.documentElement.clientWidth + '';?
如何从clientWidth中减去2?var宽度必须为(document.dococumentElement.clientWidth)-2
var width = document.documentElement.clientWidth + '';
我想不是这样的:
var width = document.documentElement.clientWidth-2 + ''; ?
谢谢AO
只需进行
var width = document.documentElement.clientWidth-2;
无需添加字符串,除非您希望结果为字符串。
相关文章:
- 正在寻找比$(document).ready慢的$(window).load的替代方案
- document.open/document.write没有正确地清除chrome中的文档——这是chrome的错误吗
- 如何用更合适的内容替换document.write
- document.styleSheets不返回任何内容
- jQuery document.ready not working
- $(document).height()在刷新时随机化值(Safari 5.1.10)
- reactjs this.refs vs document.getElementById
- 如何通过adf中的document.getElementById获取inputText字段值
- window.opener.document在ie中不起作用
- contentWindow.document.body is null
- document.applet.method在Mounatin Lion上抛出safari 6+JDK7异常
- document.getElementById(“st”).click();不起作用
- $(document).height和$(window).heaght都返回相同的值-使用的是正确的doctype
- jQuery document.ready停止代码
- document.getElementById并使用id名称
- 使用jQuery 1.8.1准备好多个$(document).是否有任何开销
- document.getElementById在js中不起作用
- document.getElementById.style.backgroundImage not working
- 停止对document.ready函数的重定向/刷新
- 是否可以 document.getElementsByTagName('head')[0] ever 返回 null