iframe 将子页面的title显示在主页面中

在index界面中,在左侧导航栏的点击事件中添加以下代码

    //导航栏点击跳转
    $(".leftList .item ul").on('click', 'li', function (event) {

      var name = $(this).text();

      $(document).attr('title',name);

      //储存导航栏状态
      sessionStorage.setItem("liActive", $(this).index());
      if ($(this).attr("src")) {
        $(".rightCont iframe").attr("src", $(this).attr("src"));
      } else {
        $(".rightCont iframe").attr("src", "404.html");
      }
      return false;
    });

 

posted @ 2019-03-11 10:23  ▁▁丶小白 ℡  阅读(1274)  评论(0)    收藏  举报