用javascript 来实现动态下拉以及收起的动态效果

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="com.ibeifeng.po.*"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
Employee employee=(Employee)session.getAttribute("employee");
Role role=(Role)session.getAttribute("role");
if(employee==null){
    
    response.sendRedirect(basePath+"admin/login.jsp");
    return;
}
Set<String> resource = (Set<String>) session
.getAttribute("resource");

if (!resource.contains("3_1")) {
//response.sendRedirect(basePath + "admin/login.jsp");
return;
} else {

}


%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<title><%=Title.TITLE %></title>
<link type="text/css" rel="stylesheet" href="<%=basePath %>style/admin/index/backhead.css" />
<link type="text/css" rel="stylesheet" href="<%=basePath %>style/admin/exam/exam.css" />
<link type="text/css" rel="stylesheet" href="<%=basePath %>style/admin/editor.css" />
<script language="javascript" charset="UTF-8" src="<%=basePath %>js/jquery.js" ></script>
<script language="javascript" charset="UTF-8" src="<%=basePath %>include/Of/LanguagePacks/L.js"></script>
<script language="javascript" charset="UTF-8">if(typeof window.L === 'object' && typeof window.L.init === 'function')
{
    window._ROOT_URL = window.L._rootUrl = '';
    window.L._adminUrl = '/admin' || undefined;
    window.L.init([], '');
}
if(!window.L.extension.jsErrorLog)
{
        window.L.extension.jsErrorLog = true;
    window.οnerrοr=function(message ,file ,line)
    {
        file = file.substr(file.indexOf(window.L._rootUrl ,7)+window.L._rootUrl.length);
        window.L.AJAX({
            url    : window.L._rootUrl + '/include/Of/Log/writeJsLog.php'
            ,async : true
            ,data  : window.L.param.encode({'message' : message, 'file' : file, 'line' : line})
            ,type  : 'post'
        });
            }
}</script>

<%--bottom: 0; position: fixed;--%>
<style type="">

#footerSlideContainer {
height:20px;

left: 0;
width: 100%;
}


</style>
<link rel="stylesheet"
    href="<%= basePath%>kindeditor/themes/default/default.css" />
<link rel="stylesheet"
    href="<%= basePath%>kindeditor/plugins/code/prettify.css" />
<script charset="utf-8" src="<%= basePath%>kindeditor/kindeditor-min.js"></script>
<script charset="utf-8" src="<%= basePath%>kindeditor/lang/zh_CN.js"></script>
<script charset="utf-8"
    src="<%= basePath%>kindeditor/plugins/code/prettify.js"></script>
</head><body style="background: white;"><script>



//页面加载完毕后初始化试题
var selectedPaperId=null;//选择的试卷id
var ids="";//选中的人员ids


var flag=false;
$(document).ready(function(){
    
    
    
            var original_h = $('#footerSlideContent').height(); // 先拿取高度
            
            
            if(original_h==null){
                original_h=350;
                
            }
<%--                $('#footerSlideContent').height(0); // 隐藏整个 Content--%>
<%--                document.getElementById("peopleSelectIframe").style.display='none';--%>
                
                $('#footerSlideNav').click(function(){
                
                    if(!flag){
                    
                        $('#footerSlideContent').animate({
                        'height' : original_h // 回复 footerSlideContent 的高度,用 animate 效果
                        });
                        flag=!flag;
                        
                        document.getElementById("peopleSelectIframe").style.display='block';
                    }else{
                        $('#footerSlideContent').animate({
                        'height' : 0 // 回复 footerSlideContent 的高度,用 animate 效果
                        });
                        flag=!flag;
                        document.getElementById("peopleSelectIframe").style.display='none';
                        
                    }    
                        
                });
    
});
var planRemark=null;
$(function() {
    // 自定义插件 #1
    
     var config={resizeType : 1,
                allowPreviewEmoticons : false,
                allowImageUpload : true,
                uploadJson : '../../upload/upload_json.jsp',
                fileManagerJson : './../upload/file_manager_json.jsp',
                allowFileManager : true,
                items : [
                    'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
                    'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright',
                     '|', 'emoticons', 'image', 'link']};
    
     planRemark = KindEditor.create('textarea[name="remark"]', config);
    
});

function setPaperName(str,id){
<%--    $("#paperName").html(str);--%>
<%--    selectedPaperId=id;--%>
}
var myselect=1;
function changeSelctMode(mode){
<%--    if(mode==2){--%>
<%--        $("#peopleSelectIframe").attr("src","peopleSelectByWorkType.jsp");--%>
<%--        myselect=2;--%>
<%--    }else{--%>
<%--        $("#peopleSelectIframe").attr("src","peopleSelect.jsp");--%>
<%--        myselect=1;--%>
<%--    }--%>
    
}



function  checkDate(){
    
    var startTime=    $("#exam_begin_tm").val();
    var endTime=    $("#exam_end_tm").val();
    
    
    var currentDate=new Date();
    
    var currentYear=currentDate.getFullYear();
    
    //alert(startTime);
    
     //alert(currentDate.getMonth()+1);
    
    // currentDate.getDay(); //  myDate.getMonth();      //获取当前月份(0-11,0代表1月)
   // currentDate.getDate();      //获取当前日(1-31)
    
    
    var now=currentYear+"-"+(currentDate.getMonth()+1)+"-"+currentDate.getDate();
   
   
    //alert(currentDate);
    if(startTime!=null&&startTime!=""&&(startTime<now)){
        
            //alert(now);
        
        alert("开始时间不能小于当前时间,请重新选择")
        
            $("#exam_begin_tm").val("");
        return;
    }
    
    
    if(startTime!=null&&startTime!=""&&endTime!=null&&endTime!=""){
        if(startTime>endTime){
            alert("开始时间不能大于结束时间,请重新选择");
            $("#exam_begin_tm").val("");
            $("#exam_end_tm").val("");
            return;
        }
        
        
    }
}

function checkForm(){
    var planName=$("#planName").val();
    if("" == planName){
        alert("考试名称不能为空");
        return;
    }
    var beginTime=$("#exam_begin_tm").val();
    var endTime=$("#exam_end_tm").val();
    if(beginTime==""){
        alert("考试开始时间不能为空");
        return;
    }
    if(endTime==""){
        alert("考试结束时间不能为空");
        return;
    }
    if(selectedPaperId==null){
        alert("选择的试卷不能为空");
        return;
    }
    if(ids==""){
        alert("选择的考试人员不能为空");
        return;
    }
    var level="";
    level=$("#level").val();
    var mode="";
    mode=$("#mode").val();
    var remark=planRemark.html();
     $.ajax({
            type: 'post',
            url: '<%=basePath%>addPlanAction.action',
            data: {
                'planEmployeeids':ids,
                'examid':selectedPaperId,
                'startTime':beginTime,
                'endTime':endTime,
                'planName':planName,
                'level':level,
                'planMode':mode,
                'remark':remark,
                'selectMode':myselect
            },
            dataType: 'json',
            success: function (data) {
                //$("#myForm").submit();
                //grid.flexReload({});
                alert("保存成功");
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                try {
                    if (p.onError) p.onError(XMLHttpRequest, textStatus, errorThrown);
                } catch (e) {}
            }
        });
    
    //alert("试卷id:"+selectedPaperId+"     人员ids:"+ids );
}

function createForm(){
      //     alert(ids);// 组织id; 1,2,18,
           var planid=window.opener.selectedPlanid;//24
          //alert(planid);
          
       document.getElementById("analysisTable_id").src="<%=basePath%>analysisAction.action?orgids="+ids+"&pid="+planid;
          
             document.getElementById("table_id").style.display='block';
            
            
        //document.getElementById("footerSlideNav").click();
            document.getElementById("peopleSelectIframe").style.display='none';
                $('#footerSlideContent').animate({
                        'height' : 0 // 回复 footerSlideContent 的高度,用 animate 效果
                        });
                        flag=false;
                        
                     document.getElementById("ifrmamecontainer").style.display='block';    
                        
                        
}


function show(){
    document.getElementById("table_id").style.display='block';    

     document.getElementById("ifrmamecontainer").style.display='block';    
    
    $('#footerSlideContent').animate({
                        'height' : 0 // 回复 footerSlideContent 的高度,用 animate 效果
                        });
                        flag=true;
                        document.getElementById("peopleSelectIframe").style.display='none';
    
     var planid=window.opener.selectedPlanid;//24
    
    
    
    
     document.getElementById("analysisTable_id").src="<%=basePath%>analysisAction.action?columnPic=yes&orgids="+ids+"&pid="+planid;
    
    
    
}

function examValidateExamInfo() {
 
}
</script>
        
        
<!--<div class="box block_1"> // block_## 序号对应全局的颜色定义 -->
    <div class="box_inner">
    
        <!-- 查询页面的条件 -->
        
        <div id="exam_info_div" >
        <!-- // 考试设置 -->
    
        
        <!-- // 表格数据 -->
    
        
        <!-- // 指定人员+表格数据 -->
        
            
<%--        <div id="footerSlideContainer">--%>
<%--         <div id="footerSlideNav"> 1111111111323331111</div>--%>
<%--             <div id="footerSlideContent">11111111111111--%>
<%--         --%>
<%--             </div>--%>
<%--        </div>--%>
<%--        --%>
        <div  id="footerSlideContainer" class="panel_1 con_search">
            <div class="title"><span  id="footerSlideNav">请指定需要统计的组织(选择需该组织的父级组织)</span>
            
            
                <a href="javascript:void(0)" οnclick="show()"  class="btn"  style='display:none;float: right'  >查看柱状图</a>
                <a href="javascript:void(0)" οnclick="createForm()"  class="btn"  style='float: right'  >生成统计表</a>
            </div>
            
            <div class="content" id="footerSlideContent" height="350px">
                <iframe id="peopleSelectIframe" src="peopleSelectForAnalysis.jsp" width="100%" height="350px" frameborder="no" border="0"  style="overflow-x: hidden;scrolling='yes'"></iframe>
            </div>
            
            
<%--            <div id="qsn_list_div" class="panel_1 con_table">--%>
                <div class="button_area_search" id='ifrmamecontainer' style='display:none'>
                        <div class="center"  id="table_id"  width="100%">
<%--                        <iframe src="analysisTable.jsp" id='analysisTable_id' width="100%"  height="500px" frameborder="no" border="0" marginwidth="0" style="overflow-x: hidden;scrolling='yes' marginheight="0" scrolling="no" allowtransparency="yes"></iframe>--%>
                
                    <iframe src="analysisTable.jsp" id='analysisTable_id' width="100%"  height="350px" frameborder="no" border="0" marginwidth="0" style="overflow-x: hidden;scrolling='yes' marginheight="0"  allowtransparency="yes"></iframe>
                
                    </div>
<%--            </div>--%>
            
                </div>
        
    
 
 
        
                
                    <script type="text/javascript">
window.L
        .strVar(
                "L.extension.pageTable.callback.afterLoadList[]",
                window.L
                        .strVar(
                                "L.extension.pageTable.callback.initLoadList[]",
                                function(pageTableObj, pageTableClass, index,
                                        type) {
                                    if (pageTableObj
                                            .getAttribute("_pagetabledataset") === "admin_question_questionCtl::displayQsnList") {
                                        loadFunctionBar("pageTable");
                                        if (type === "init") //显示查询总数目
                                        {
                                            $(function() {
                                                var pageTableJqObj = $(pageTableObj);
                                                var offset = pageTableJqObj
                                                        .offset(); //分页位置
                                                var totalitemId = (pageTableObj.id || pageTableJqObj
                                                        .attr(
                                                                "_pagetabledataset")
                                                        .replace("::", "_"))
                                                        + "TotalitemLable";
                                                var totalitemJqObj; //显示总数据条数

                                                $("#" + totalitemId).remove();
                                                totalitemJqObj = $(
                                                        '<span id="'
                                                                + totalitemId
                                                                + '" style="position:absolute; left:-100px; top:-100px;">共'
                                                                + pageTableJqObj
                                                                        .attr("_pagetabletotalitems")
                                                                + '条</span>')
                                                        .appendTo(
                                                                window.L
                                                                        .getWindow(pageTableObj).document.body);

                                                totalitemJqObj
                                                        .css( {
                                                            "top" : offset.top
                                                                    - totalitemJqObj
                                                                            .outerHeight(),
                                                            "left" : offset.left
                                                                    + pageTableJqObj
                                                                            .outerWidth()
                                                                    - totalitemJqObj
                                                                            .outerWidth()
                                                        });
                                            })
                                        }
                                    }
                                }));</script>
                </div>


<!--   table end- -->


    </div>
    
</div><!-- // box end --></div><script language="javascript" charset="UTF-8" src="<%=basePath %>js/admin/manyTrees.js" ></script>
<script language="javascript" charset="UTF-8" src="<%=basePath %>js/admin/tag/tag.js" ></script>
<script language="javascript" charset="UTF-8" src="<%=basePath %>js/admin/common.js" ></script>
<%--<script language="javascript" charset="UTF-8" src="<%=basePath %>js/admin/exam/exam_modify.js" >--%>
</script><script language="javascript" charset="UTF-8" src="<%=basePath %>js/admin/paper/paper2.js" ></script>
<%--<script language="javascript" charset="UTF-8" src="<%=basePath %>js/admin/userApi.js" ></script>--%>
</body></html>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值