需要有关HTML,jQuery,Javascript的帮助 [英] Need Help with HTML, jQuery, Javascript

查看:74
本文介绍了需要有关HTML,jQuery,Javascript的帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用JQuery创建一个网站.我使用了"HTML页面中的页面"的想法来在母版页(default.html)中显示一个页面(例如home.html).
-以下是我在Default.html中用于菜单的代码-

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>



-以下是Default.html中我的意思的代码-



-- 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>



我在default.html页面中的iframe广告代码的帮助下使用了这个想法.

同样,我使用了jquery脚本,该脚本通过ID标识帧并在单击主页上的特定菜单时隐藏/显示它们.这意味着,如果我单击默认html页面的联系我们"菜单,则会隐藏除包含ContactUs.html子html页面的iframe以外的所有iframe.
-以下是我放入.js文件中的代码-



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();
    });
});


-------------------------------------------------- ------------------------------
在这里,当我按菜单栏上的主菜单时,它应显示id ="iFrameHome"的iframe,并隐藏id ="iFrameCareers"和id ="iFrameContactUs"的iframe.以相同的方式对待所有人.

目前,我想要的是正在发生的事情,但是时间很短.意味着,当我们在默认页面上按主页"菜单时,它将显示ID为"iFrameHome"的iframe 1秒钟,然后再次开始一起显示所有框架.

我想跟着,如果单击联系我们"菜单,则该页面应仅聚焦于Default.html页面中id为"iFrameContactUs"的iframe,并且所有页面均相同.

请帮我解决这个问题.


--------------------------------------------------------------------------------
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.

推荐答案

(document).ready(function(){
(document).ready(function(){


(# iFrameCareers).hide();
("#iFrameCareers").hide();


("#iFrameContactUs).hide();
("#iFrameContactUs").hide();


这篇关于需要有关HTML,jQuery,Javascript的帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆