开发者

jquerymobile: can I embed one page into another

开发者 https://www.devze.com 2023-04-05 19:45 出处:网络
Can I embed one page (data-role=\"page\")开发者_运维知识库 in another page like: <div data-role=\"page\"> <!-- outer page -->

Can I embed one page (data-role="page")开发者_运维知识库 in another page like:

<div data-role="page"> <!-- outer page -->
  <div data-role="header"></div>
  <div data-role="content">
  <div data-role="page"> <!-- inner page -->
    <div data-role="header"></div>
    <div data-role="content">
        inner page content goes here....
    </div>
    <div data-role="footer"></div>
  </div> <!-- inner page -->
  <div data-role="footer"></div>
</div> <!-- outer page -->

When I tried like this, i didn't see my content but outer header, footers displaying for me.

Thanks, nehatha.


No, you cannot. Pages are not meant to be embedding each other. May be you can probably write what are you trying to achieve by this?

You have two options.

  1. Write your own transition logic, which will not be very difficult, you can say $('#content').html(new html); on every button click and keep only one page.
  2. use data-position="fixed" for header and footer in jQuery mobile and use normal page, this way your header and footer will not move on scrolling, paginating.

Multi-page template structure: http://demos.jquerymobile.com/1.4.2/transitions/pages/

0

精彩评论

暂无评论...
验证码 换一张
取 消