当前位置: 代码迷 >> BODY的解决方案
 
  • iframe 自适应高度[ff,ie上大同小异]

    iframe自适应高度[ff,ie下大同小异] ?法一:<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <htmlxmlns="http://www.w3.org/1999/xhtml"> &l...

    17
    热度
  • js-运用JS向页面动态添加radio

    js---使用JS向页面动态添加radio 开发过程中,需要使用JS向页面动态添加radio,实现时通过document.createElement()方法来实现,刚开始的代码如下: 1.var_radio=document.createElement("input"); 2._radio.type="radio"; 3._radio.name="_radio"; 4.document.body...

    24
    热度
  • JavaScript 默许使username文本框获得焦点的例子

    JavaScript默认使username文本框获得焦点的例子 <head> <scripttype="text/javascript"> functionclearpassword(){?document.getElementById("password").value="";?document.getElementById("username").focus();} &...

    118
    热度
  • EasyUI的window加载的页面不执行js有关问题说明

    EasyUI的window加载的页面不执行js问题说明 解决方案:将被加载页面中的body标签删掉.说明:window、dialog、tab都是panel,加载内容的方式都有硬编码和通过url来加载外部html片段,这里html片段就是body标签里面的代码.详细参见:http://easyui.btboys.com/post-49.html 1楼 seeYourEye 2012-10-24 ...

    125
    热度
  • JavaScript兑现简单的时钟

    JavaScript实现简单的时钟<html> <head> <title>JS实现简单的时钟</title> <script> functiondisplayTime(){ document.getElementById("time").innerHTML=newDate().toTimeString(); }...

    252
    热度
  • IE中,JS在操作style属性时报出"找不到成员"异常

    IE中,JS在操作style属性时报出"找不到成员"错误 同样一行代码:document.body.style=document.body.style||{}在IE中会报出"找不到成员"的错误,貌似IE中不支持这种style操作。项目中有一个类似的代码,也没看出来这行代码作用有多大,直接判断浏览器略过了,测试倒是没有影响。如果IE中要修改style的话看来还得一个一个的操作啊。

    378
    热度
  • JS取网页的阔与高-多种情况细细说来

    JS取网页的宽与高-多种情况细细说来 注:以下方法兼容IE6,7,FF3。 下面是取网页的宽与高,情况很复杂,有正文宽高,窗口宽高,可能有滚动条. 有滚动条时正文高一定大于窗口高, 无滚到条时正文高可能小于等于窗口高。 宽度同理,就不说了。 应用1 :用JS取浏览器窗口内侧的宽与高,动态调整页面的宽度(或高度),求:网页可见区域宽(或高),就是下面代码中的Width_4(Height_4)。...

    70
    热度
  • js统制onclick事件实例

    js控制onclick事件实例 <html> <head> </head> <body> <buttonid="a1">点击</button> <script> functiontest(){ document.getElementById("a1").onclick=function(){alert(...

    119
    热度
  • js窗口封锁事件

    js窗口关闭事件 window.onbeforeunload=functionwindow.onbeforeunload(){????if(event.clientX>document.body.clientWidth&&event.clientY<0||event.altKey){???????alert(111);????}else{ ?????????window...

    64
    热度
  • JavaScript 判断下传文件大小

    JavaScript判断上传文件大小 <scripttype="text/javascript"> functiongetFileSize(filePath){ varimage=newImage(); image.dynsrc=filePath; alert(image.fileSize); } </script> <body> <INPUTTYPE="...

    123
    热度
  • 怎么Radio点击它会被选中,再次点击会取消选中

    怎样Radio点击它会被选中,再次点击会取消选中? <!DOCTYPEHTMLPUBLIC"-//W3C//DTDHTML4.0Transitional//EN"> <HTML> <script> functionuncheck() { varradio=document.getElementById("rad"); if(radio.tag==1){radio...

    94
    热度
  • JS获取银幕,浏览器,网页高度宽度

    JS获取屏幕,浏览器,网页高度宽度 网页可见区域宽:document.body.clientWidth网页可见区域高:document.body.clientHeight网页可见区域宽:document.body.offsetWidth(包括边线的宽)网页可见区域高:document.body.offsetHeight(包括边线的宽)网页正文全文宽:document.body.scrollWidt...

    35
    热度
  • 在weblogic portal中引来dojo【备忘】

    在weblogicportal中引入dojo【备忘】 最近使用oracleworkshopforweblogic开发porlet 使用dojo作为js框架,但是dojo在引入的时候有点问题因为有个初始变量要设置 djConfig={parseOnLoad:true,isDebug:true}; 因为要把dojo框架放到lookandfeel的skin.xml当中,因此不能像以前那样写: <s...

    133
    热度
  • JS统制窗口居中

    JS控制窗口居中 <html><scriptlanguage="JavaScript">varx=640;vary=480;varxx=(window.screen.width-x)/2;varyy=(window.screen.height-y)/2;functionwinsize(){window.resizeTo(x,y);window.moveTo(xx,yy);s...

    76
    热度
  • js获取控件的门类

    js获取控件的类型 可以用document.getElementById("objId").type;获得控件的类型例子如下<html> <body> <scripttype="text/javascript"> functiongetType(){ varbut=document.getElementById("but").type; vartext=docu...

    40
    热度
  • javascript获取各种浏览器足见窗口大小

    javascript获取各种浏览器可见窗口大小 ? Js代码 functiongetInfo() { vars=""; s+="网页可见区域宽:"+document.body.clientWidth; s+="网页可见区域高:"+document.body.clientHeight; s+="网页可见区域宽:"+document.body.offsetWidth+"(包括边线和滚动条的...

    107
    热度
  • JAVAScript失去控件的坐标

    JAVAScript得到控件的坐标 functiongetAbsoluteHeight(ob){ returnob.offsetHeight } functiongetAbsoluteWidth(ob){ returnob.offsetWidth } functiongetAbsoluteLeft(ob){ varmendingLeft=ob.offsetLeft; while(ob!=null...

    250
    热度
  • apply 运用的一个例子

    apply使用的一个例子 <html> <head> <title>test</title> <script> MyObj={ a:1, show:function(){ alert(11111111); } } functiontest(a){ alert(this.a); } window.onload=function(){ te...

    587
    热度
  • JQ1.8 $(object).attr("scrollHeight") 不起作用了咋回事

    JQ1.8$(object).attr("scrollHeight")不起作用了怎么回事?JQ1.8$(object).attr("scrollHeight")不起作用了怎么回事? vara=$("#user_list>ul")find("li:first").attr("scrollWidth") alert(a) 结果为NaN怎么回事呢,以前用这语法都能得到数值的。 ...

    620
    热度
  • 正题:JavaScript执行顺序的小测试

    主题:JavaScript执行顺序的小测试 <html> <head> <title>test.html</title> <scripttype="text/javascript"src="jquery-1.4.2.js"></script> <scripttype="text/javascript"> wind...

    38
    热度