我有两个相同的文件。唯一的区别是扩展。然而,两个文件中的Javascript以不同的方式做事。基本上我控制页面高度的javascipt但是当扩展名为php时,它开始将高度设置为异常。
有两个页面: http://test.lu-creative.com/users/tables_dynamic.html, http://test.lu-creative.com/users/tables_dynamic.php
请注意,PHP需要滚动但不需要滚动。两者都使用相同的JavaScript函数。
处理高度的javascript代码是:
$RIGHT_COL.css('min-height', $(window).height());
var bodyHeight = $BODY.outerHeight(),
footerHeight = $BODY.hasClass('footer_fixed') ? -10 : $FOOTER.height(),
leftColHeight = $LEFT_COL.eq(1).height() + $SIDEBAR_FOOTER.height(),
contentHeight = bodyHeight < leftColHeight ? leftColHeight : bodyHeight;
// normalize content
contentHeight -= $NAV_MENU.height() + footerHeight;
console.log(contentHeight);
$RIGHT_COL.css('min-height', contentHeight);
//$RIGHT_COL.css('min-height', '2000px');
可以在此仓库找到这些文件: https://github.com/Kunwark/kkcms/tree/master/public/users
答案 0 :(得分:4)
您的问题出在Custom.js第5036行:
// check active menu
$SIDEBAR_MENU.find('a[href="' + CURRENT_URL + '"]').parent('li').addClass('current-page');
$SIDEBAR_MENU.find('a').filter(function () {
return this.href == CURRENT_URL;//5036
}).parent('li').addClass('current-page').parents('ul').slideDown(function() {
setContentHeight();
}).parent().addClass('active');
你正在调整魔法大小是基于匹配的网址。问题是this.href包含一个在两个页面中以tables_dynamic.html结尾的URL,因此tables_dynamic.php永远不会匹配。