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元素时是“$ ”和“#”的筛选器。

        最后,加一分呗。 

  • 相关阅读:
    thinkphp3.2生成二维码
    php实现图片下载
    yii2.0 Activeform表单部分组件使用方法
    Yii2美化confirm
    Yii2学习笔记之场景
    tp5页面输出时,搜索后跳转下一页的处理
    php页面输出时,js设置input框的选中值
    mac中使用rz,sz上传文件
    golang的命令行程序开发
    Sring MVC基于Java Config方式配置Mybatis, 无XML
  • 原文地址:https://www.cnblogs.com/ssol/p/2470561.html
Copyright © 2011-2022 走看看