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
Post a Comment