I am using JQuery to create a website. I have used an idea "A Page in a html page" to display one page (for example home.html) in a master page(default.html).
-- Following is the code I have used for Menu in Default.html --
<div id="PSMenu" class="class_MenuTab">
<ul>
<li><a id="mnuHome" href=""> Home </a></li>
<li><a id="mnuTechnology" href=""> Technology </a></li>
<li><a id="mnuMethodology" href="">Methodology</a></li>
<li><a id="mnuServices" href="">Services</a></li>
<li><a id="mnuAboutus" href="">About us</a></li>
<li><a id="mnuCareers" href="">Careers</a></li>
<li><a id="mnuContactus" href="">Contact us</a></li>
</ul>
</div>
-- Following is the code in Default.html for what I meant --
<table id="Table_FrameContainer" cellpadding="0" cellspacing="0" border="0">
<tr>
<td id="tdIFrameContainer">
<iframe id="iFrameHome" class="SubPage" src="Home.html" scrolling="no">
</iframe>
<iframe id="iFrameCareers" class="SubPage" src="Careers.html" scrolling="no">
</iframe>
<iframe id="iFrameContactUs" class="SubPage" src="ContactUs.html" scrolling="no">
</iframe>
</td>
</tr>
</table>
I used this idea with the help of iframe tags in default.html page.
For the same, I have used the jquery script which identifies the frames by there IDs and hide/show them when particular menus are clicked on homepage. This means, if I click 'Contact Us' menu of default html page, it hides all iframes other than iframe containing ContactUs.html sub html page.
-- Following is the code I have put in .js file--
$(document).ready(function(){
$("#iFrameCareers").hide();
$("#iFrameContactUs").hide();
$("#iFrameHome").show();
$("#mnuHome").click(function(){
$("#iFrameCareers").hide();
$("#iFrameContactUs").hide();
$("#iFrameHome").show();
});
$("#mnuCareers").click(function(){
$("#iFrameHome").hide();
$("#iFrameContactUs").hide();
$("#iFrameCareers").show();
});
$("#mnuContactus").click(function(){
$("#iFrameHome").hide();
$("#iFrameCareers").hide();
$("#iFrameContactUs").show();
});
});
--------------------------------------------------------------------------------
Here, when I press Home menu on menu bar, it should display the iframe with id="iFrameHome" and hide iframes with id="iFrameCareers" and id="iFrameContactUs". In the same manner for all.
Currently, what I want is happening, but for very short time. Means, when we press Home menu in default page it displays iframe with id="iFrameHome" for 1 second and again start displaying all the frames together.
I want following, If the Contact Us menu is clicked, the page should focus only the iframe with id="iFrameContactUs" in Default.html page and same for all the pages.
Please help me out for this issue.
Thank you very much for help in advance.