zoukankan      html  css  js  c++  java
  • Jquery实现“Iframe”页面切换

    一:Defualt.aspx页面下的“IFrame”

            <iframe id="BoardTitle" name="BoardTitle" style="height: 100%; visibility: inherit; 198; z-index: 2"
                        scrolling="auto" frameborder="0" src="left.aspx"></iframe> 

            <iframe id="mainFrame" name="mainFrame" style="height: 100%; visibility: inherit;
                        100%; z-index: 1" scrolling="auto" frameborder="0" src="Welcome.aspx"></iframe> 

    二:实现切换页面

         <script type="text/javascript">

            function b_click() {
                $('#BoardTitle', parent.document).attr("src", "Admin/TVDepartAll.aspx");
                $('#mainFrame', parent.document).attr("src", "Welcome.aspx");
    //            window.location.href = window.location.href;
      
            };
           
      
            function bt_un_click() {
                $('#BoardTitle', parent.document).attr("src", "left.aspx");
                $('#mainFrame', parent.document).attr("src", "Admin/TVDepartAll.aspx");
    //            window.location.href = window.location.href;
            };
            function NowShow(Url) {
                window.parent.frames["mainFrame"].location = Url;
            }
        </script> 

        

           <input id="Bt_Binding" type="button" value="绑定"  class="buttoncss" onclick="b_click()" />&nbsp;<input id="Button1" type="button" value="解绑"  class="buttoncss" onclick="bt_un_click()" /> 

    三: 与“TreeView”结合,使页面显示到指定框架

           myNode.NavigateUrl = "javascript:NowShow('"+url_all+"')";
            //myNode.Target = "mainFrame"; 

    四:注意

         1、切换时,切换的页面会被重新加载。

         2、 Jquery获取Document元素时是“$ ”和“#”的筛选器。

        最后,加一分呗。 

  • 相关阅读:
    windows7上使用docker容器
    centos7 docker镜像加速器配置
    用列表生成器打印九九乘法表
    -bash: wget: command not found的两种解决方法
    centos7 Dockerfile安装nginx
    centos6.5关闭防火墙命令
    centos7开机启动tomcat7
    centos7安装tomcat7
    CentOS7防火墙firewalld
    poj_3662 最小化第k大的值
  • 原文地址:https://www.cnblogs.com/ssol/p/2470561.html
Copyright © 2011-2022 走看看