Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/78.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何在Jquery中的if条件后返回div的初始高度值_Javascript_Jquery_Html_Event Handling - Fatal编程技术网

Javascript 如何在Jquery中的if条件后返回div的初始高度值

Javascript 如何在Jquery中的if条件后返回div的初始高度值,javascript,jquery,html,event-handling,Javascript,Jquery,Html,Event Handling,以上代码在鼠标悬停上正常工作。根据条件高度增加,但我在哪里可以添加鼠标以获得初始高度?以获得初始高度?填写空白部分即变量hif可能,然后提供小提琴请以获得初始高度?填写空白部分即变量hif可能,然后提供小提琴请 $(document).ready(function() { var h = $(this).parent("ul").height(); $(".tile_nav ul li").mouseover(function() { var hh = $(th

以上代码在鼠标悬停上正常工作。根据条件高度增加,但我在哪里可以添加鼠标以获得初始高度?

以获得初始高度?
填写空白部分
    即变量hif可能,然后提供小提琴请
    以获得初始高度?
    填写空白部分
      即变量hif可能,然后提供小提琴请
      $(document).ready(function() {
          var h = $(this).parent("ul").height();
          $(".tile_nav ul li").mouseover(function() {
      
              var hh = $(this).children("ul").height();
              var h = $(this).parent("ul").height();
      
              var mainbottm = $(this).parent("ul").position().top + $(this).parent("ul").outerHeight(true);
              var bottom = $(this).children("ul").position().top + $(this).children("ul").outerHeight(true);
      
              var diff = bottom - mainbottm;
              var toppossub = $(".cm_rhs").offset().top;
              $(".cm_lhs h1").html("Sub UL" + bottom + "Main UL bottom " + mainbottm + " diff " + diff);
              var newulheight = h + diff;
              if (diff > 0) {
                  $(".tile_nav ul").css("height", newulheight);
                  s
              }
          });
      
          $(".tile_nav ul li").mouseleave(function() {
              $(".tile_nav ul").css("height", h);
          });
      });