2013-11-15 3 views
0

내 프로젝트에서 단추를 클릭하고 부모 (뒤에) 페이지를 표시하면 jsp 페이지가 흐려 지도록하고 싶습니다.JSP 페이지 페이드

<html> 
<head> 
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
    <title>JSP Page</title> 
    <style type="text/css"> 
     <!-- 
     .style1 { 
      font-family: Arial, Helvetica, sans-serif; 
      font-weight: bold; 
      font-size: 12px; 
     } 
     --> 
    </style> 
    <link href="css/buttons.css" rel="stylesheet" type="text/css"/> 
</head> 
<body> 
    <form name="form1" method="post" action="analystServlet"> 
     <table width="100%" border="0" cellspacing="1" cellpadding="1"> 
      <tr> 
       <td>&nbsp;</td> 
       <td>&nbsp;</td> 
      </tr> 
      <tr> 
       <td><span class="style1">Choose Source</span></td> 
       <td><select name="source"> 
         <option>Excel</option> 
         <option>Database</option> 
        </select></td> 
      </tr> 
      <tr> 
       <td><input type="hidden" name="id" value="494"/></td> 
       <td>&nbsp;</td> 
      </tr> 
      <tr> 
       <td colspan="2"><div align="center"> 
         <input type="submit" class="button" onclick="hide()" name="exportHome" value="Submit"/> 
        </div></td> 
      </tr> 
     </table> 
    </form> 

</body> 
내가이 페이지가 퇴색 될 수있다 제출 '버튼을 클릭합니다. 감사합니다, Karthika KM

+0

당신이 JSP를 숨기고 무엇을 의미합니까? 당신은 클릭 몇 가지 버튼을 기반으로 JSP의 일부 요소를 숨기시겠습니까? – Renjith

+0

plz, 시도한 코드를 공유하십시오. – Arvind

+0

그냥 페이지를 숨기고 싶습니다. – user2990782

답변

2

당신은 사용하여 작업을 수행 할 수 있습니다 아약스/JQuery와 만

function closeMe() 
     {  
      window.opener.location.reload(true); // reload parent page 
      window.close(); // close this page     
     } 

    $("#submitbtn").click(function(e) { 
      e.preventDefault(); 

     var params = { 
        // here pass form parameter 
       }; 

    $.ajax({ 
      type: "POST", 
      url: "/analystServlet", 
      data: params, 
      success: function(data){ 

       $('body').css("background", "rgba(0,0,0,0.5)").fadeOut("slow"); 
       setTimeout(function() { 
        closeMe(); 
       }, 1000); // 1000 = 1 secs           
      }       
    }); // end of $.ajax()