Javascript Div内容跨越页面页脚时出现问题
这里有个简单的问题。我一直在努力让我的代码的内容部分填充到页面的页脚。我尝试在css中添加以下内容类型padding bottom的hack:5000px margin bottom:-5000px;我也遵循了这个指南,但是我没有得到我想要的结果。 以下是正在发生的事情的屏幕截图:Javascript Div内容跨越页面页脚时出现问题,javascript,jquery,cordova,jquery-mobile,html,Javascript,Jquery,Cordova,Jquery Mobile,Html,这里有个简单的问题。我一直在努力让我的代码的内容部分填充到页面的页脚。我尝试在css中添加以下内容类型padding bottom的hack:5000px margin bottom:-5000px;我也遵循了这个指南,但是我没有得到我想要的结果。 以下是正在发生的事情的屏幕截图: 接受订单 页脚 这是一个有效的解决方案,我正在我的工作中使用它 $("div[data-role='page']").live('pageshow',function(e,data){
接受订单
页脚
这是一个有效的解决方案,我正在我的工作中使用它
$("div[data-role='page']").live('pageshow',function(e,data){
var header = $("div[data-role='header']:visible");
var footer = $("div[data-role='footer']:visible");
var content = $("div[data-role='content']:visible:visible");
var viewport_height = $(window).height();
var content_height = viewport_height - header.outerHeight() - footer.outerHeight();
if((content.outerHeight() - header.outerHeight() - footer.outerHeight()) <= viewport_height) {
content_height -= (content.outerHeight() - content.height());
content.height(content_height);
}
});
$(“div[data role='page'])。live('pageshow',函数(e,data){
var header=$(“div[data role='header']:可见”);
var footer=$(“div[data role='footer']:可见”);
var content=$(“div[data role='content']:可见:可见”);
var viewport_height=$(窗口).height();
var content_height=viewport_height-header.outerHeight()-footer.outerHeight();
如果((content.outerHeight()-header.outerHeight()-footer.outerHeight())这里有一个有效的解决方案,我将在我的
$("div[data-role='page']").live('pageshow',function(e,data){
var header = $("div[data-role='header']:visible");
var footer = $("div[data-role='footer']:visible");
var content = $("div[data-role='content']:visible:visible");
var viewport_height = $(window).height();
var content_height = viewport_height - header.outerHeight() - footer.outerHeight();
if((content.outerHeight() - header.outerHeight() - footer.outerHeight()) <= viewport_height) {
content_height -= (content.outerHeight() - content.height());
content.height(content_height);
}
});
$(“div[data role='page'])。live('pageshow',函数(e,data){
var header=$(“div[data role='header']:可见”);
var footer=$(“div[data role='footer']:可见”);
var content=$(“div[data role='content']:可见:可见”);
var viewport_height=$(窗口).height();
var content_height=viewport_height-header.outerHeight()-footer.outerHeight();
如果((content.outerHeight()-header.outerHeight()-footer.outerHeight())被“下到页脚”你的意思是想让下方的蓝色条位于视口的下边缘吗?什么指南?我们需要一些CSS或示例页面来提供帮助。首先尝试将内容的高度设置为100%;如果模拟器上没有结果,可以设置一些背景。通过“下到页脚”你的意思是想让下方的蓝色条位于视口的下边缘吗?什么指南?我们需要一些CSS或示例页面来提供帮助。首先尝试将内容的高度设置为100%;如果模拟器上没有结果,可以设置一些背景。从jQuery 1.7开始,.live()
方法已弃用。使用.on()
附加事件处理程序。较旧版本的jQuery用户应优先使用.delegate()
,而不是.live()
。自jQuery 1.7起,.live()
方法已弃用。使用.on())
附加事件处理程序。较旧版本的jQuery用户应优先使用.delegate()
,而不是.live()
。