zoukankan      html  css  js  c++  java
  • Jquery 父窗口中移进移出鼠标到Iframe: 移进显示更多内容, 移出隐藏部分内容

    //父窗口中的JS
      //设置iframe的高度
      function heightSet(){
         if($.browser.mozilla || $.browser.msie){
             bodyHeight =window.frames["iFrame2"].document.body.scrollHeight;
         }else{
             bodyHeight = document.getElementById("iFrame2").contentWindow.document.documentElement.scrollHeight;
         }
         document.getElementById("iFrame2").height=bodyHeight;  
      }
    
    //Iframe中的JS
      //去除不符合要求的节点
      $(".Stat_list").each(function(){
          var sumFirstCategory=$(this).attr("sumFirstCategory");
          if(sumFirstCategory==0){
              $(this).children("ul").remove();
          }
      });
      
      function hiddenMore(){
          //如果数量超过多少就隐藏
          var isShowMoreBt=0;
          $(".subject").each(function(index){
              if(index>20){
                  $(this).nextAll(".subject").css("display", "none");
                  $(this).parents(".Stat_list").nextAll(".Stat_list").css("display", "none");
                  isShowMoreBt=1;
                  return false;
              }
          });
    
          //如果超过多少就隐藏
          $(".category").each(function(index){
              if(index>0){
                  $(this).parents(".Stat_list").nextAll(".Stat_list").css("display", "none");
                  isShowMoreBt=1;
                  return false;
              }
          });
          //是否显示省略号
          if(isShowMoreBt==1){
              $("#showMore_div").show();
          }  
      }
    
     //鼠标移进移出操作(Iframe)
      $("#content_all").hover(
          function () {
               $("#showMore").hide();
               $(".Stat_list").show();
               parent.window.heightSet();
          },
          function () {
               hiddenMore();
               $("#showMore").show();
               parent.window.heightSet();
          }
      );
  • 相关阅读:
    hdu 1028 Ignatius and the Princess III (n的划分)
    CodeForces
    poj 3254 Corn Fields (状压DP入门)
    HYSBZ 1040 骑士 (基环外向树DP)
    PAT 1071 Speech Patterns (25)
    PAT 1077 Kuchiguse (20)
    PAT 1043 Is It a Binary Search Tree (25)
    PAT 1053 Path of Equal Weight (30)
    c++ 常用标准库
    常见数学问题
  • 原文地址:https://www.cnblogs.com/krisy/p/2847360.html
Copyright © 2011-2022 走看看