javascript - How to get back initial height value of div after if condition in Jquery -


$(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);     }); }); 

above code working on mouseover. based on condition height increasing can add mouseleave getting initial height of ?


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -