web网页设置

来源:互联网 发布:如何查看淘宝店铺等级 编辑:程序博客网 时间:2024/06/05 10:38

1.给table添加 滚动条

    style:overflow

   style="width:100%;height:200px;overflow-y:auto;word-break:break-all"

2.在表格中添加按钮

<TD align="center">
       <BUTTON style="PADDING-LEFT: 5px; WIDTH: 70px" class=button
      type=submit">
      <SPAN style="CURSOR: default" class=icon_remove>修改</SPAN>
      </BUTTON>
    </TD>

3. 表格中添加checkbox

<td width="25"><input type="checkbox" value="<s:property value='id'/>"/></td>

4.表格中添加序号

前提:<s:iterator  value="webDBList" status="status" >

<td width="50" class="ali02"><s:property value="#status.index+1+webDBList.nextIndex-15"/></td>

5.对checkbox 多选的每一个进行处理,id使用“,”间隔

$(":checkbox:checked").each(function (){}

6. 界面重定位

 <action name="yuansitematch" class="com.wzty.platform.web.actions.crawl.SubSiteManageAction" method="siteMatch">
            <result type="xdtech-redirect-action">
    <param name="actionName">yuansitemanage</param>
    <param name="page">${page}</param>
    <param name="message">${message}</param>
   </result>
        </action>

7.各种框

 alert()

confirm()

var user = prompt("完成日期",strDate);

8.分页显示

<div style="width: 100%px;height: 28px;" align="right">
<x:page name="webDBList" page="page" callback="var tmphref = this.href; if(tmphref==null)tmphref=this.action; this.href='javascript:;';doClickGet(tmphref);return false;" url="yuansitemanage.dhtml"
param="{'type':webDBList.totalCount,'name':webDBList.nextIndex,'siteid':siteid,'url':url}"/>&nbsp;&nbsp;

 其中使用的是自定义标签

 自定义标签代码:

  省略。。。。

9、表单提交不跳转页面

   可使用方案:

   1.使用target 标签

     target  指定一个iframe

   2.使用JQuery


$.ajax({
    cache: true,
    type: "POST",
    url:ajaxCallUrl,
    data:$('#yourformid').serialize(),// 你的formid
    async: false,
       error: function(request) {
           alert("Connection error");
       },
       success: function(data) {
        $("#commonLayout_appcreshi").parent().html(data);
       }
   });

 10.框架刷新

   <input type=button value="刷新1" onclick="window.parent.frames[1].location.reload()"><br>
<input type=button value="刷新2" onclick="window.parent.frames.bottom.location.reload()"><br>
<input type=button value="刷新3" onclick="window.parent.frames['bottom'].location.reload()"><br>
<input type=button value="刷新4" onclick="window.parent.frames.item(1).location.reload()"><br>
<input type=button value="刷新5" onclick="window.parent.frames.item('bottom').location.reload()"><br>
<input type=button value="刷新6" onclick="window.parent.bottom.location.reload()"><br>
<input type=button value="刷新7" onclick="window.parent['bottom'].location.reload()"><br>
11.form 提交 跳转问题

      使用target 标签

    值描述_blank在新窗口中打开。_self默认。在相同的框架中打开。_parent在父框架集中打开。_top在整个窗口中打开。framename在指定的框架中打开。

 12.遍历checkbox

$("input:checked").each()

 var checkIds = $(":checkbox:checked");

13.select 多选框设置

var selectids= document.getElementById("typename");
  for(i=0;i<selectids.options.length;i++){  
        if(selectids.options[i].selected){
             alert("hello");
             alert(selectids.options[i].value);
            intvalue+=selectids.options[i].value+",";
        }
    }

<select multiple="multiple" size="5" name="typename" id="typename"
 

原创粉丝点击