Solved

How to put close button on iframe.

Posted on 2012-03-21
3
422 Views
Last Modified: 2012-03-26
have a look on http://www.indiannursingcouncil.org/gfatm/testcharts/home.aspx

When i click on any link on map, a frame gets opened.I want to have a close button for this frame.
Currently the block disappears on mouseout event, which i want on close button.
Kindly help.
The code is as follows:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<title>GFATM 7 Training Management Information System</title>
<link href="css/mapsstyle.css" rel="stylesheet" type="text/css"/>
<LINK rel=icon type="image/ico" href="images/favicon.ico">
<script type="text/javascript" src="Visifire2.js" ></script>
    <script type="text/javascript">

        // Initial chart DataXml, It will be set from the Managed code in Page_Load Event
        var initialChartXml;

        // Define visifire chart
        var vChart = new Visifire2("SL.Visifire.Charts.zip", 355, 300);

        /* Call this function to render the chart. You need to make sure that
        *  VisifireChart0 div is ready before you render the chart */
        function renderChart(dataxml)
        {

            if (document.getElementById('VisifireChart0') != null)
            {
                vChart.setDataXml(dataxml);
                vChart.render('VisifireChart0');
            }
        }
     
    </script>
<script type="text/javascript" language="javascript">
        function DoSomething(id)
        {
            var popup = document.getElementById("iFrameContainer");
            var frame = document.getElementById("myFrame");
            if (popup != null && frame != null)
            {
                frame.src = "StateDetails.aspx?Id=" + id;
                popup.style.display= "block";
               
            }
        }
     
     
    </script>
    <style type="text/css">
        .style20
        {
            color: #FFFFFF;
            font-size: small;
        }
        .style24
        {
            height: 160px;
        }
        .style244
        {
            width: 301px;
            height: 160px;
            background-image: url('images/5.jpg');
        }
       
        .style27
        {
            height: 50px;
            width: 31px;
        }
        .style28
        {
            width: 954px;
        }
       a {font-family:arial; font-size:small}
       a:link {color:white;}
       a:visited {color: #FFFFFF;}
       a:hover {text-decoration: none; color: #000040;}
        a:active {color: red;text-decoration: none}
       


               
        .style31
        {
           
            background-position: left top;
            background-repeat: no-repeat;
            padding-left: 15px;
            text-align: left;
            font-family: Verdana, Arial, Helvetica, sans-serif;
            font-size: x-small;
            color: #333333;
            font-weight: normal;
            padding-bottom: 4px;
            float: left;
        }
       
               
   
        .style31
        {
            text-align: left;
            height: 16px;
           
            font-family:Arial;
            font-size:small;
        }

               
        .style251
        {
            width: 900px;
            height:100px;
        }

               
        .style253
        {
            height: 18px;
            text-align: left;
            font-family: Arial;
            color: #FFFFFF;
            font-size: small;
            width: 100px;
        }
        .style254
        {
            height: 23px;
        }

               
        .style255
        {
            width: 31px;
        }
        .style256
        {
            height: 23px;
            width: 31px;
        }
       
               
        .style259
        {
            width: 200px;
        }

               
        .style262
        {
            color: #3366FF;
            font-family: Arial, Helvetica, sans-serif;
            font-size: small;
        }
            area{
                  cursor:pointer;      
            }

               
        </style>

   
</head>

<body style="margin-top:0px; text-align:center">
<form id="form1" runat="server">

<table width="960" border="0" cellpadding="0" class="main_table" style="padding-top:15px;">
  <tr>
    <td align="center" class="style28">
        <table width="894" border="0" cellpadding="0" cellspacing="0">
          <tr>
                <td width="182" class="main_table_paddng" style="padding-left:0px;padding-right:0px">
              <img src="images/header copy1.jpg"  class="style251" />
            </td>
          </tr>
        </table>
   </td>
  </tr>
  <tr>
        <td>
          <table width="1000" border="0" cellpadding="0" cellspacing="0">
              <tr>
                  <td valign="top" align="left" style="width:500px;float:left;padding:0;margin:0;">
                      
                         <div id="iFrameContainer" style="z-index:+1; position:absolute;left:480px; top:125px; display:none;" onmouseout="this.style.display='none'">
         <iframe src="#" id="myFrame" width="400" height="500" frameborder="1">
       
         </iframe>
                        </div>
                     
                       
                        <div><img src="images/india_map3.jpg" width="563" height="653" border="0" usemap="#Map">
                          <map name="Map" id="Map">
                          <area shape="rect" coords="492,251,532,263" id="e3" onclick ="JavaScript:DoSomething(this.id);" />
                          <area shape="rect" coords="315,280,362,291" id="e6" onclick ="JavaScript:DoSomething(this.id);" />
                          <area shape="rect" coords="371,288,426,300" id="e7" onclick ="JavaScript:DoSomething(this.id);" />
                         
                          <area shape="rect" coords="428,273,461,283" id="e8" onclick ="JavaScript:DoSomething(this.id);" />
                          <area shape="rect" coords="173,103,247,114" id="n1" onclick ="JavaScript:DoSomething(this.id);" />
                          <area shape="rect" coords="215,148,269,157" id="n4" onclick ="JavaScript:DoSomething(this.id);" />
                          <area shape="rect" coords="138,128,167,138" id="n5" onclick ="JavaScript:DoSomething(this.id);" />
                          <area shape="rect" coords="179,133,229,143" id="n6" onclick ="JavaScript:DoSomething(this.id);" />
                          <area shape="rect" coords="143,51,219,64" id="n7" onclick ="JavaScript:DoSomething(this.id);" />
                          <area shape="rect" coords="138,167,174,178" id="n8" onclick ="JavaScript:DoSomething(this.id);" />
                          <area shape="rect" coords="187,177,239,188" id="n9" onclick ="JavaScript:DoSomething(this.id);" />
                          <area shape="rect" coords="222,211,281,222" id="n10" onclick ="JavaScript:DoSomething(this.id);" />
                          <area shape="rect" coords="323,235,354,246" id="n11"  onclick ="JavaScript:DoSomething(this.id);" />
                          <area shape="rect" coords="383,186,412,196" id="ne1"  onclick ="JavaScript:DoSomething(this.id);"/>
                          <area shape="rect" coords="511,220,553,230" id="ne2"  onclick ="JavaScript:DoSomething(this.id);"/>
                          <area shape="rect" coords="464,217,495,227" id="ne3"  onclick ="JavaScript:DoSomething(this.id);"/>
                          <area shape="rect" coords="426,242,474,253" id="ne4"  onclick ="JavaScript:DoSomething(this.id);"/>
                          <area shape="rect" coords="467,176,546,188" id="ne5"  onclick ="JavaScript:DoSomething(this.id);"/>
                          <area shape="rect" coords="251,330,310,342" id="s2"  onclick ="JavaScript:DoSomething(this.id);"/>
                          <area shape="rect" coords="304,350,336,362" id="s7"  onclick ="JavaScript:DoSomething(this.id);"/>
                          <area shape="rect" coords="477,282,518,293" id="s9"  onclick ="JavaScript:DoSomething(this.id);"/>
                          <area shape="rect" coords="230,532,280,544" id="s12"  onclick ="JavaScript:DoSomething(this.id);"/>
                          <area shape="rect" coords="113,470,164,483" id="s13"  onclick ="JavaScript:DoSomething(this.id);"/>
                          <area shape="rect" coords="169,553,221,567" id="s14"  onclick ="JavaScript:DoSomething(this.id);"/>  
                          <area shape="rect" coords="187,423,257,435" id="s16"  onclick ="JavaScript:DoSomething(this.id);"/>
                          <area shape="rect" coords="76,453,101,464" id="s17"  onclick ="JavaScript:DoSomething(this.id);"/>
                          <area shape="rect" coords="123,555,155,567" id="s18"  onclick ="JavaScript:DoSomething(this.id);"/>  
                          <area shape="rect" coords="96,217,145,229" id="w1"  onclick ="JavaScript:DoSomething(this.id);"/>
                          <area shape="rect" coords="50,288,86,300" id="w2"  onclick ="JavaScript:DoSomething(this.id);"/>
                          <area shape="rect" coords="112,366,168,379" id="w11"  onclick ="JavaScript:DoSomething(this.id);">
                          <area shape="rect" coords="167,288,239,302" id="w12"  onclick ="JavaScript:DoSomething(this.id);"/>  
                          </map>
                        </div>
                      
                </td>
                <td valign="top" align="right" style="height:653px;width:380px;float:right;padding:0;margin:0;">
                      <table>
                          <tr>
                              <td>
                               
                                    <div id="VisifireChart0" style="height: 300px; width: 355px;">
                   
                    <script type="text/javascript">

                        // Renders the initial chart soon after page loads
                        renderChart(initialChartXml);
                       
                    </script>
                </div>

               </td>
       
                           
                        </tr>
                    </table>
                      <div class="indexBG">
                          <div align="center">
                            <div class="graph_desc_1">
                                <table width="320" border="0" cellspacing="5" class="style24">
                                    <tr>
                                       <tr>
                                      <td style="color:White;width:150px;text-align:left;font-family:Arial;font-size:small">Nurses Trained</td>
                                      <td class="style256">
                                      <span class="style20">:</span></td>
                                      <td class="style254"><span class="style20"><asp:Label id="lbltontotal" runat ="server" Text='<%# Eval("A")%>'></asp:Label></span></td>
                                     
                                      </asp:Label>  </td>
                                    </tr>
                       
                                    <tr>
                                      <td style="color:White;width:150px;text-align:left;font-family:Arial;font-size:small">Trainers Trained</td>
                                      <td class="style256">
                                      <span class="style20">:</span></td>
                                      <td class="style254"><span class="style20"><asp:Label id="lbltottotal" runat ="server" Text='<%# Eval("A")%>'></asp:Label></span></td>
                                    </tr>
                       
                                    <tr>
                                       <td style="color:White;width:150px;text-align:left;font-family:Arial;font-size:small">Master Trainers Trained</td>
                                      <td class="style255"><span class="style20">:</span></td><td><span class="style20">
                                      <asp:Label id="lblmtottotal" runat ="server" Text='<%# Eval("A")%>'></asp:Label></span></td>
                                    </tr>                    
                                    <tr>
                                       <td style="color:White;width:150px;text-align:left;font-family:Arial;font-size:small">TON's Conducted</td>
                                          <td class="style255"><span class="style20">:</span></td><td><span class="style20">
                                          <asp:Label id="lblton" runat ="server" Text='<%#Eval("A")%>'></asp:Label></span></td>
                                          </tr>
                                    <tr>
                                       <td style="color:White;width:150px;text-align:left;font-family:Arial;font-size:small">TOT's Conducted</td>
                                      <td class="style255"><span class="style20">:</span></td><td><span class="style20">
                                      <asp:Label id="lbltot" runat ="server" Text='<%# Eval("A")%>'></asp:Label></span></td>
                                    </tr>
                                    </table>
                             </div>
                        </div>
                    </div>
                    <div>
                          <table border="0" align="center" cellpadding="0" cellspacing="0" class="style244">
                          <tr>
                           <td class="style31">
                                  <a id="A1" runat="server" target="_blank" href="loginpi.aspx">
                                  Performance Indicators</a>
                              </td>
                          </tr>
                          <tr>
                              <td class="style31">
                                  <a id="h2" runat="server" target="_blank" href="viewitc.aspx">
                                  Institutes/Trainers/Calandar</a>
                              </td>
                          </tr>
                          <tr>
                            <td class="style31">
                                <a id="h3" runat="server" target="_blank" href="newsletters.aspx">
                                Newsletters</a>
                            </td>
                          </tr>
                          <tr>
                            <td class="style31">
                                <%--<a id="h5" runat="server" target="_blank" href="http://www.atlasadvisories.com/HIV_AIDS_ART/">
                                e-learning</a>--%>
                                <a id="h5" runat="server" target="_blank" href="uc.aspx">e-learning</a>
                               
                            </td>
                          </tr>
                          <tr>
                            <td class="style31">
                                <a id="h4" runat="server" target="_blank" href="loginsms.aspx">
                                <span lang="en-us">Send SMS</span></a>
                            </td>
                          </tr>
                          <tr>
                            <td class="style31">
                                <a id="h6" runat="server" target="_blank" href="signupincfutures.aspx">INC/Futures Login
                                </a>
                            </td>
                          </tr>
                          <tr>
                            <td class="style31">
                           <a id="h7" runat="server" target="_blank" href="logindataentry.aspx">Data Entry Dashboard</a>            
                              </td>
                          </tr>
                         
                        </table>
                    </div>
                </td>
            </tr>
        </table>
    </td>
  </tr>
   <tr>
        <td width="884"  style=" text-align:center;" class="style262" >© 2008, India Nursing Council, All rigths reserved
      </tr>
  <tr>
        <td align="center" style="font-family:Arial, Helvetica, sans-serif; font-size:11px; color:#999999; padding-bottom:20px;">
           
            <strong>
       
          </td>
      </tr>
</table>
    </form>
</body>
</html>
0
Comment
Question by:searchsanjaysharma
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 16

Accepted Solution

by:
Easwaran Paramasivam earned 500 total points
ID: 37751803
In IFrame and ASPX is loaded. Isn't it? In that ASPX page itself you can have close button. On clicking the button you can hide the iFrame.

Otherwise you can use window.opan(), window.ShowModalDailag() methods to open a dialog with  pop-up. In that case you no need to have Close button explictly.

http://javascript.gakaa.com/window-showmodaldialog-4-0-5-.aspx
http://www.javascript-coder.com/window-popup/javascript-window-open.phtml
0
 

Author Comment

by:searchsanjaysharma
ID: 37751917
How to call statedetails.aspx file with showmodaldialog, kindly merge it.
0
 

Author Closing Comment

by:searchsanjaysharma
ID: 37767301
ok
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ASP.NET Calendar Control 5 54
asp.net mvc5 6 33
Conformation code 4 35
display data from multiple ajax calls 9 41
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question