想做一个类似百度登陆那种效果的弹窗,搜到很多结果,在新建的jsp中使用,可以弹出窗口,但是把这段代码加到项目原有的页面里面就不能弹窗了,项目原本的页面包含很多JS,css,用的是struts标签,希望大家指点下,是哪方面的错误导致新加入的js不发生效果
这是那个例子
script language="javascript">
function show(){
id1.style.height=window.screen.height+"px";
id1.style.width=window.screen.width+"px";
id1.style.display='block';
id2.style.display='block'
}
function hide(){
id1.style.display='none'
id2.style.display='none'
}
</script>
<div id="id2" >
这里可以放内容,或者添加div用innerhtml进行添加内容就可以了
<br/>
<input name="Button1" type="button" value="button" onclick="hide()"/>
<input type="text">
</div>
<div id="id1"> 123</div>
<button onclick="show()" class="BUTTON">修改</button>
这是那个例子
script language="javascript">
function show(){
id1.style.height=window.screen.height+"px";
id1.style.width=window.screen.width+"px";
id1.style.display='block';
id2.style.display='block'
}
function hide(){
id1.style.display='none'
id2.style.display='none'
}
</script>
<div id="id2" >
这里可以放内容,或者添加div用innerhtml进行添加内容就可以了
<br/>
<input name="Button1" type="button" value="button" onclick="hide()"/>
<input type="text">
</div>
<div id="id1"> 123</div>
<button onclick="show()" class="BUTTON">修改</button>
解决方案 »
- ibatis查出的时间格式问题
- 请教关于权限和工作流的问题
- 奇葩!PreparedStatement.executeUpdate执行之后的问题
- 求一sql语句
- struts2 简单验证框架
- 我试用snmp4j这个开源包,求windowsxp系统的MIB,查询相应的oid
- ~~~~~~~~~~小弟跪问啊!关于Hibernate Synchronizer的问题!~~~~~~~~帮忙up的都有分啊
- WAS5.1中在STRUTS架构下开发的项目设置首页的问题
- 关于jBuilder 7 中的字体
- 跪求基于(struts2+spring+hibernate)SSH源码
- 请教JTable中键盘选择行事件响应问题
- 求救哇。This method must return a result of type String
id1.style.width=window.screen.width+"px";
这样写不需要加‘px’吧
document.getElementById("id2").style.width=window.screen.width;
你这么写这两句就对了
其实多试几次就好了,至于什么原因错误,我不清楚,我找了个正确的路
把那些东西作为一个新的js文件导入就没问题了,我就在想,导入一个新的文件和直接把function写在里面难道不一样罢了,慢慢学