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