gpt4 book ai didi

jquery - Rails 的 jquery 移动布局的一个很好的例子是什么?

转载 作者:行者123 更新时间:2023-12-01 01:28:55 25 4
gpt4 key购买 nike

下面是我用作针对移动设备的 Rails 项目的主要布局。我根据 jquery mobile 文档导出了页面、页眉、内容和页脚数据角色。有 jquery 移动经验的人是否发现以下 haml 布局中存在明显的缺陷?

!!! 5
%html

%head
%title= h(yield(:title))
%meta{"http-equiv"=>"Content-Type", :content=>"text/html; charset=utf-8"}/
%meta{:name => "viewport", :content => "width=device-width, initial-scale=1"}/
= stylesheet_link_tag "http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.css"
= javascript_include_tag "http://code.jquery.com/jquery-1.6.1.min.js", "http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.js"
= yield(:head)

%body
.app_page{"data-role" => :page, "data-theme" => :b}
= yield(:header)

.app_content{"data-role" => :content}
~ yield

.app_footer{"data-role" => :footer}
= yield(:footer)

最佳答案

我会确保您的 header 位于带有 "data-role"=>:header 的 div 中,但否则您的布局看起来是正确的。

是什么让您认为它有缺陷?它似乎遵循 jquery-mobile 的页面对象规范,并且没有任何特定于 Rails 的布局需要考虑。

关于jquery - Rails 的 jquery 移动布局的一个很好的例子是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5478981/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com